async def timer(ctx, *, timer_spec: str): command_log_info(ctx.message.author.name, "timer", timer_spec) channel = { "id": ctx.message.channel.id, "name": str(ctx.message.channel), } author = { "id": ctx.message.author.id, "name": ctx.message.author.name, } em = clock.on_timer(channel, author, timer_spec) if em: await ctx.message.channel.send(embed=em)
async def weather(ctx, *, request_location=None): command_log_info(ctx.message.author.name, "weather", str(request_location)) if request_location is None: em = weather_helper_repeat_user(str(ctx.message.author.id), location_token, open_weather_token) else: em = weather_helper( str(ctx.message.author.id), request_location, location_token, open_weather_token, ) await ctx.message.channel.send(embed=em)
async def imgur(ctx, *, request_query: str): command_log_info(ctx.message.author.name, "imgur", request_query) em = imgur_top(request_query, imgur_id) # Note: This is not good form but is a quick way to get the intended # behavior. Currently discord embeds do not support anything other than # image filetypes. Imgur likes to use .mp4 which do not like to be used in # embed data types. So if it's a video/mp4 type we just return the string # and paste it directly to the channel where discord will embed it by # itself. Technically this loses the link to the album which ruins the # purpose of embed systems, but its a sacrifice and should be looked into # soon. if isinstance(em, Embed): await ctx.message.channel.send(embed=em) elif isinstance(em, str): await ctx.message.channel.send(em)
async def urbanDict(ctx, *args): if len(args) == 2 and args[1].isdigit(): request_definition = args[0] numOfDefs = int(args[1]) command_log_info( ctx.message.author.name, "multiple urbanDict", request_definition + str(numOfDefs), ) em = urbanDict_multiple(request_definition, numOfDefs) else: request_definition = " ".join(args) command_log_info(ctx.message.author.name, "single urbanDict", request_definition) em = urbanDict_helper(request_definition) await ctx.message.channel.send(embed=em)
async def uuidGenerator(ctx, *, request_value=0): command_log_info(ctx.message.author.name, "uuid", str(request_value)) em = random_helper("UUID", request_value) await ctx.message.channel.send(embed=em)
async def roll(ctx, *, dice_spec: str = "d2"): command_log_info(ctx.message.author.name, "diceRoll", str(dice_spec)) await ctx.message.channel.send(embed=roll_helper(dice_spec))
async def thesaurusLookup(ctx, *, request_definition: str): command_log_info(ctx.message.author.name, "Thesaurus Lookup", request_definition) em = thes_helper(request_definition, webster_thesaurus_token) await ctx.message.channel.send(embed=em)
async def websterLookup(ctx, *, request_definition: str): command_log_info(ctx.message.author.name, "Webster Definition", request_definition) em = websterDict_helper(request_definition, webster_definition_token) await ctx.message.channel.send(embed=em)
async def wikiLookup(ctx, *, request_definition: str): command_log_info(ctx.message.author.name, "Wikipedia Article", request_definition) em = wiki_helper(request_definition) await ctx.message.channel.send(embed=em)
async def wolfram(ctx, *, request_query: str): command_log_info(ctx.message.author.name, "wolfram", request_query) em = wolf_short_query(request_query, wolfram_token) await ctx.message.channel.send(embed=em)
async def au_tier(ctx, *, request_word: str): command_log_info(ctx.message.author.name, "au_tier", request_word) constructedString = aug_finder(request_word) await ctx.message.channel.send(constructedString)
async def reddit_top(ctx, *, request_subreddit: str): command_log_info(ctx.message.author.name, "reddit", request_subreddit) em = reddit_top3(request_subreddit) await ctx.message.channel.send(embed=em)
async def d_message(ctx): command_log_info(ctx.message.author.name, "d", "d") await ctx.message.channel.send("d")
async def time(ctx, *, query: str): command_log_info(ctx.message.author.name, "time", query) em = time_helper(query) if em: await ctx.message.channel.send(embed=em)
async def stock(ctx, *, query=None): command_log_info(ctx.message.author.name, "stock", str(query)) em = stock_helper(query) await ctx.message.channel.send(embed=em)