Let's try again
This commit is contained in:
34
Gwendolyn.py
34
Gwendolyn.py
@ -24,19 +24,19 @@ async def on_ready():
|
|||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
if message.content.lower().startswith("!help"):
|
if message.content.lower().startswith("!help"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !help\n")
|
print("\n"+localtime+"\n"+message.author.name+" ran !help\n")
|
||||||
file = open("help.txt","r")
|
file = open("help.txt","r")
|
||||||
em = discord.Embed(title = "Help", description = file.read(),colour = 0x59f442)
|
em = discord.Embed(title = "Help", description = file.read(),colour = 0x59f442)
|
||||||
await message.channel.send(embed = em)
|
await message.channel.send(embed = em)
|
||||||
|
|
||||||
if message.content.lower().startswith("!hello"):
|
if message.content.lower().startswith("!hello"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !hello")
|
print("\n"+localtime+"\n"+message.author.name+" ran !hello")
|
||||||
await message.channel.send(helloFunc(message.author.name))
|
await message.channel.send(helloFunc(message.author.name))
|
||||||
|
|
||||||
elif message.content.lower().startswith("!roll"):
|
elif message.content.lower().startswith("!roll"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !roll")
|
print("\n"+localtime+"\n"+message.author.name+" ran !roll")
|
||||||
if message.content.lower() == "!roll" or message.content.lower() == "!roll ":
|
if message.content.lower() == "!roll" or message.content.lower() == "!roll ":
|
||||||
print(roll_dice(message.author.name))
|
print(roll_dice(message.author.name))
|
||||||
await message.channel.send(roll_dice(message.author.name))
|
await message.channel.send(roll_dice(message.author.name))
|
||||||
@ -45,12 +45,12 @@ async def on_message(message):
|
|||||||
|
|
||||||
elif message.content.lower().startswith("!spell "):
|
elif message.content.lower().startswith("!spell "):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !spell")
|
print("\n"+localtime+"\n"+message.author.name+" ran !spell")
|
||||||
await message.channel.send(spellFunc(message.content))
|
await message.channel.send(spellFunc(message.content))
|
||||||
|
|
||||||
elif message.content.lower().startswith("!monster "):
|
elif message.content.lower().startswith("!monster "):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !monster")
|
print("\n"+localtime+"\n"+message.author.name+" ran !monster")
|
||||||
title, text1, text2, text3, text4, text5 = monsterFunc(message.content)
|
title, text1, text2, text3, text4, text5 = monsterFunc(message.content)
|
||||||
em1 = discord.Embed(title = title, description = text1, colour=0xDEADBF)
|
em1 = discord.Embed(title = title, description = text1, colour=0xDEADBF)
|
||||||
await message.channel.send(embed = em1)
|
await message.channel.send(embed = em1)
|
||||||
@ -93,17 +93,17 @@ async def on_message(message):
|
|||||||
|
|
||||||
elif message.content.lower().startswith("!map"):
|
elif message.content.lower().startswith("!map"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !map")
|
print("\n"+localtime+"\n"+message.author.name+" ran !map")
|
||||||
await message.channel.send("https://i.imgur.com/diMXXJs.jpg")
|
await message.channel.send("https://i.imgur.com/diMXXJs.jpg")
|
||||||
|
|
||||||
elif message.content.lower().startswith("!image"):
|
elif message.content.lower().startswith("!image"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !image")
|
print("\n"+localtime+"\n"+message.author.name+" ran !image")
|
||||||
await message.channel.send(imageFunc())
|
await message.channel.send(imageFunc())
|
||||||
|
|
||||||
elif message.content.lower().startswith("!movie"):
|
elif message.content.lower().startswith("!movie"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !movie")
|
print("\n"+localtime+"\n"+message.author.name+" ran !movie")
|
||||||
async with message.channel.typing():
|
async with message.channel.typing():
|
||||||
title, plot, cover, cast = movieFunc()
|
title, plot, cover, cast = movieFunc()
|
||||||
if title == "error":
|
if title == "error":
|
||||||
@ -116,32 +116,38 @@ async def on_message(message):
|
|||||||
|
|
||||||
elif message.content.lower().startswith("!name"):
|
elif message.content.lower().startswith("!name"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !name")
|
print("\n"+localtime+"\n"+message.author.name+" ran !name")
|
||||||
await message.channel.send(nameGen())
|
await message.channel.send(nameGen())
|
||||||
|
|
||||||
elif message.content.lower().startswith("!tavern"):
|
elif message.content.lower().startswith("!tavern"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !tavern")
|
print("\n"+localtime+"\n"+message.author.name+" ran !tavern")
|
||||||
await message.channel.send(tavernGen())
|
await message.channel.send(tavernGen())
|
||||||
|
|
||||||
elif message.content.lower().startswith("!game "):
|
elif message.content.lower().startswith("!game "):
|
||||||
gamePlaying = cap(message.content.lower().replace("!game ",""))
|
gamePlaying = cap(message.content.lower().replace("!game ",""))
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !game, changing the game to '"+gamePlaying+"'")
|
print("\n"+localtime+"\n"+message.author.name+" ran !game, changing the game to '"+gamePlaying+"'")
|
||||||
game = discord.Game(gamePlaying)
|
game = discord.Game(gamePlaying)
|
||||||
await client.change_presence(activity=game)
|
await client.change_presence(activity=game)
|
||||||
|
|
||||||
elif message.content.lower().startswith("!swroll"):
|
elif message.content.lower().startswith("!swroll"):
|
||||||
localtime = time.asctime( time.localtime(time.time()) )
|
localtime = time.asctime( time.localtime(time.time()) )
|
||||||
print(localtime+"\n"+message.author.name+" ran !swroll")
|
print("\n"+localtime+"\n"+message.author.name+" ran !swroll")
|
||||||
command = cap(message.content.lower().replace("!swroll",""))
|
command = cap(message.content.lower().replace("!swroll",""))
|
||||||
await message.channel.send(parseRoll(message.author.name,command))
|
await message.channel.send(parseRoll(message.author.name,command))
|
||||||
|
|
||||||
elif message.content.lower().startswith("!swchar"):
|
elif message.content.lower().startswith("!swchar"):
|
||||||
localtime = time.asctime(time.localtime(time.time()))
|
localtime = time.asctime(time.localtime(time.time()))
|
||||||
print(localtime+"\n"+message.author.name+" ran !swchar")
|
print("\n"+localtime+"\n"+message.author.name+" ran !swchar")
|
||||||
command = cap(message.content.lower().replace("!swchar",""))
|
command = cap(message.content.lower().replace("!swchar",""))
|
||||||
await message.channel.send(parseChar(message.author.name,command))
|
title, desc = parseChar(message.author.name,command)
|
||||||
|
if title != "":
|
||||||
|
em1 = discord.Embed(title = title, description = desc, colour=0xDEADBF)
|
||||||
|
await message.channel.send(embed = em1)
|
||||||
|
else:
|
||||||
|
await message.channel.send(desc)
|
||||||
|
|
||||||
|
|
||||||
client.run("MzgwNzI4OTkwMTEwODQyODgx.DO81GQ.rctkEQtieciETXnmsYbwZvvOkaA")
|
client.run("MzgwNzI4OTkwMTEwODQyODgx.DO81GQ.rctkEQtieciETXnmsYbwZvvOkaA")
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ def lookUp(data : dict, key : str, cmd : str = ""):
|
|||||||
return key + " doesn't exist"
|
return key + " doesn't exist"
|
||||||
|
|
||||||
def characterSheet(character : dict):
|
def characterSheet(character : dict):
|
||||||
return "```**"+character["Name"]+"**\nSpecies: "+character["Species"]+"\nCareer: "+character["Career"]+"```"
|
return character["Name"]+"Species: "+character["Species"]+"\nCareer: "+character["Career"]
|
||||||
|
|
||||||
def charData(user : str,cmd : str):
|
def charData(user : str,cmd : str):
|
||||||
with open("characters.json", "r") as f:
|
with open("characters.json", "r") as f:
|
||||||
@ -157,7 +157,9 @@ def parseChar(user : str, cmd : str):
|
|||||||
data[user] = newChar
|
data[user] = newChar
|
||||||
with open("characters.json", "w") as f:
|
with open("characters.json", "w") as f:
|
||||||
json.dump(data,f,indent = 4)
|
json.dump(data,f,indent = 4)
|
||||||
return "Character for " + user + " created"
|
return "", "Character for " + user + " created"
|
||||||
|
else:
|
||||||
|
return "", charData(user,cmd)
|
||||||
|
|
||||||
def lightsaberChar(user : str):
|
def lightsaberChar(user : str):
|
||||||
with open("characters.json", "r") as f:
|
with open("characters.json", "r") as f:
|
||||||
|
Reference in New Issue
Block a user