From 919c064d93e5281f7f253f7fefe032f199568748 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Fri, 3 Apr 2020 16:25:49 +0200 Subject: [PATCH] Typing while getting wiki --- Gwendolyn.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index 1b880de..6ab5f8d 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -215,13 +215,14 @@ async def on_message(message): command = string.capwords(message.content.lower().replace("!wiki ","")) title, content, thumbnail = funcs.findWikiPage(command) if title != "": - funcs.logThis("Sending the embedded message") - content += "\n[Læs mere](https://senkulpa.fandom.com/da/wiki/"+title.replace(" ","_")+")" - embed = discord.Embed(title = title, description = content, colour=0xDEADBF) - if thumbnail != "": - embed.set_thumbnail(url=thumbnail) + async with message.channel.typing(): + funcs.logThis("Sending the embedded message") + content += "\n[Læs mere](https://senkulpa.fandom.com/da/wiki/"+title.replace(" ","_")+")" + embed = discord.Embed(title = title, description = content, colour=0xDEADBF) + if thumbnail != "": + embed.set_thumbnail(url=thumbnail) - await message.channel.send(embed = embed) + await message.channel.send(embed = embed) else: await message.channel.send(content)