mirror of
https://github.com/MrDetonia/Maki.git
synced 2024-11-13 00:26:53 -05:00
Remove users from tells when messages are sent, v0.9.2
This commit is contained in:
parent
a166f5c540
commit
d778360224
8
bot.py
8
bot.py
@ -23,7 +23,7 @@ from secret import email,pwd
|
||||
name = "Maki"
|
||||
|
||||
# bot version
|
||||
version = "v0.9.1"
|
||||
version = "v0.9.2"
|
||||
|
||||
# text shown by .help command
|
||||
helptext = """I am a bot written in Python by MrDetonia
|
||||
@ -157,11 +157,13 @@ def on_message(message):
|
||||
if message.author != client.user:
|
||||
|
||||
# send any messages we have for author:
|
||||
if message.author.name in tells and len(tells[message.author.name]) > 0:
|
||||
if message.author.name in tells:
|
||||
yield from client.send_message(message.channel, 'Hey ' + message.author.name + ', I have messages for you!')
|
||||
for msg in tells[message.author.name]:
|
||||
yield from client.send_message(message.author, msg[0] + ' says "' + msg[1] + '"')
|
||||
tells[message.author.name].remove(msg)
|
||||
|
||||
# delete this user's entry
|
||||
del tells[message.author.name]
|
||||
|
||||
# update messages
|
||||
with open('tells.json', 'w') as fp:
|
||||
|
Loading…
Reference in New Issue
Block a user