Add !gamenight
This commit is contained in:
18
gupbot.py
18
gupbot.py
@@ -55,12 +55,24 @@ async def on_message(message):
|
|||||||
await message.channel.send(response)
|
await message.channel.send(response)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if (message.content.startswith("!gamenight")):
|
||||||
|
members = []
|
||||||
|
for vc in message.guild.voice_channels:
|
||||||
|
for member in vc.members:
|
||||||
|
members.append(member)
|
||||||
|
|
||||||
|
if len(members) == 0:
|
||||||
|
response = f'Ain\'t nobody to choose, ya {insult_generator.hit_me(1)}!'
|
||||||
|
else:
|
||||||
|
member_idx = random.randint(0,len(members)-1)
|
||||||
|
member = members[member_idx]
|
||||||
|
response = f'I choose {member.mention} to decide tonights game!'
|
||||||
|
await message.channel.send(response)
|
||||||
|
return
|
||||||
|
|
||||||
if (message.content.startswith("!")):
|
if (message.content.startswith("!")):
|
||||||
response = f'{message.author.mention} uh, *wat*? For a list of commands, type !help.'
|
response = f'{message.author.mention} uh, *wat*? For a list of commands, type !help.'
|
||||||
await message.channel.send(response)
|
await message.channel.send(response)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client.run(TOKEN)
|
client.run(TOKEN)
|
||||||
|
|||||||
Reference in New Issue
Block a user