Help is better now

This commit is contained in:
NikolajDanger
2020-04-05 19:01:49 +02:00
parent 1e2f64c67c
commit 53855e741d
7 changed files with 50 additions and 37 deletions

View File

@ -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"):