Help is better now
This commit is contained in:
19
Gwendolyn.py
19
Gwendolyn.py
@ -70,10 +70,21 @@ async def on_message(message):
|
||||
# Sends the contents of "help.txt"
|
||||
if message.content.lower().startswith("!help"):
|
||||
funcs.logThis(message.author.name+" ran \""+message.content+"\"")
|
||||
with codecs.open("resources/help.txt",encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
em = discord.Embed(title = "Help", description = text,colour = 0x59f442)
|
||||
await message.channel.send(embed = em)
|
||||
if message.content.lower() == "!help" or message.content.lower() == "!help ":
|
||||
with codecs.open("resources/help/help.txt",encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
em = discord.Embed(title = "Help", description = text,colour = 0x59f442)
|
||||
await message.channel.send(embed = em)
|
||||
else:
|
||||
command = message.content.lower().replace(" ","-").replace("!","")
|
||||
funcs.logThis("Looking for "+command+".txt")
|
||||
try:
|
||||
with codecs.open("resources/help/"+command+".txt",encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
em = discord.Embed(title = command.replace("help-","").capitalize(), description = text,colour = 0x59f442)
|
||||
await message.channel.send(embed = em)
|
||||
except:
|
||||
await message.channel.send("Couldn't find help for that command")
|
||||
|
||||
# Stops the bot
|
||||
elif message.content.lower().startswith("!stop"):
|
||||
|
Reference in New Issue
Block a user