Changes to stuff

This commit is contained in:
NikolajDanger
2020-03-31 19:39:44 +02:00
parent 436d0443dd
commit bdb011cfc5
9 changed files with 111 additions and 22 deletions

View File

@ -47,9 +47,15 @@ async def on_message(message):
# Stops the bot
elif message.content.lower().startswith("!stop"):
localtime = time.asctime( time.localtime(time.time()) )
print("\n"+localtime+"\n"+message.author.name+" ran !stop")
logging.info("\n"+localtime+"\n"+message.author.name+" ran !stop")
await client.logout()
if message.author.name == "Nikolaj":
print("\n"+localtime+"\n"+message.author.name+" ran !stop")
logging.info("\n"+localtime+"\n"+message.author.name+" ran !stop")
await message.channel.send("Logging out...")
await client.logout()
else:
print("\n"+localtime+"\n"+message.author.name+" tried to run !stop")
logging.info("\n"+localtime+"\n"+message.author.name+" tried to run !stop")
await message.channel.send("I don't think I will, "+message.author.name)
# Does a hello with the helloFunc function from funcs/gwendolynFuncs.py
elif message.content.lower().startswith("!hello"):
@ -184,14 +190,22 @@ async def on_message(message):
logging.info("\n"+localtime+"\n"+message.author.name+" ran !swroll")
command = funcs.cap(message.content.lower().replace("!swroll",""))
await message.channel.send(funcs.parseRoll(message.author.name,command))
# Deals with Destiny Points and stuff
elif message.content.lower().startswith("!swd"):
localtime = time.asctime(time.localtime(time.time()))
print("\n"+localtime+"\n"+message.author.name+" ran !swd")
logging.info("\n"+localtime+"\n"+message.author.name+" ran !swd")
command = message.content.lower().replace("!swd","")
await message.channel.send(funcs.parseDestiny(message.author.name,command))
# Accesses and changes character sheet data with the parseChar function
# from funcs/swfuncs/swchar.py
elif message.content.lower().startswith("!swchar"):
elif message.content.lower().startswith("!swchar") or message.content.lower().startswith("!sw"):
localtime = time.asctime(time.localtime(time.time()))
print("\n"+localtime+"\n"+message.author.name+" ran !swchar")
logging.info("\n"+localtime+"\n"+message.author.name+" ran !swchar")
command = funcs.cap(message.content.lower().replace("!swchar",""))
command = funcs.cap(message.content.lower().replace("!swchar","").replace("!sw","").replace("+","+ "))
title, desc = funcs.parseChar(message.author.name,command)
if title != "":
em1 = discord.Embed(title = title, description = desc, colour=0xDEADBF)
@ -200,5 +214,6 @@ async def on_message(message):
await message.channel.send(desc)
# Runs the whole shabang
client.run(token)