Added wiki command

This commit is contained in:
NikolajDanger
2020-04-03 15:57:28 +02:00
parent 69eb12f632
commit 25e7767c82
4 changed files with 54 additions and 4 deletions

View File

@ -210,6 +210,20 @@ async def on_message(message):
else:
await message.channel.send(desc)
elif message.content.lower().startswith("!wiki "):
funcs.logThis(message.author.name+" ran \""+message.content+"\"")
command = string.capwords(message.content.lower().replace("!wiki ",""))
title, content, thumbnail = funcs.findWikiPage(command)
if title != "":
funcs.logThis("Sending the embedded message")
embed = discord.Embed(title = title, description = content, colour=0xDEADBF)
if thumbnail != "":
print(thumbnail)
embed.set_thumbnail(url=thumbnail)
await message.channel.send(embed = embed)
else:
await message.channel.send(content)
# Runs the whole shabang