More logging

This commit is contained in:
Nikolaj Danger
2020-03-24 11:09:31 +01:00
parent da0aea540c
commit de6ee115e7
3 changed files with 22 additions and 8 deletions

View File

@ -9,7 +9,7 @@ import codecs
import funcs
logging.basicConfig(filename="logfilename.log", level=logging.INFO)
logging.basicConfig(filename="gwendolyn.log", level=logging.INFO)
with open("token.txt","r") as f:
token =f.read()
@ -40,7 +40,10 @@ async def on_message(message):
em = discord.Embed(title = "Help", description = text,colour = 0x59f442)
await message.channel.send(embed = em)
if message.content.lower().startswith("!hello"):
elif message.content.lower().startswith("!stop"):
await client.logout()
elif message.content.lower().startswith("!hello"):
localtime = time.asctime( time.localtime(time.time()) )
print("\n"+localtime+"\n"+message.author.name+" ran !hello")
logging.info("\n"+localtime+"\n"+message.author.name+" ran !hello")