forked from n/quotes-bot-python
Compare commits
No commits in common. "b283f66bb8b0fae3a15d5c86fb69eb34b3104549" and "e4df14c3b76ffeccd14764c26789521bb41c31a3" have entirely different histories.
b283f66bb8
...
e4df14c3b7
1 changed files with 20 additions and 6 deletions
26
bot.py
26
bot.py
|
@ -145,11 +145,25 @@ async def help_message(room, message):
|
||||||
@bot.listener.on_message_event
|
@bot.listener.on_message_event
|
||||||
async def help_message(room, message):
|
async def help_message(room, message):
|
||||||
match = botLibrary.MessageMatch(room, message, bot, PREFIX)
|
match = botLibrary.MessageMatch(room, message, bot, PREFIX)
|
||||||
if match.is_not_from_this_bot() and match.prefix() and match.command("die"):
|
if not (match.is_not_from_this_bot() and match.prefix() and match.is_from_userid(admin)
|
||||||
if match.is_from_userid(admin):
|
and match.command("die")):
|
||||||
await bot.api.send_text_message(room.room_id, "Ok")
|
return
|
||||||
exit(0)
|
|
||||||
else:
|
message = ("Ok")
|
||||||
await bot.api.send_text_message(room.room_id, "You don't have permissions for that.")
|
|
||||||
|
await bot.api.send_text_message(room.room_id, message)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
# We should find a better way to do this.
|
||||||
|
@bot.listener.on_message_event
|
||||||
|
async def help_message(room, message):
|
||||||
|
match = botLibrary.MessageMatch(room, message, bot, PREFIX)
|
||||||
|
if not (match.is_not_from_this_bot() and match.prefix() and not match.is_from_userid(admin)
|
||||||
|
and match.command("die")):
|
||||||
|
return
|
||||||
|
|
||||||
|
message = ("You don't have permissions for that.")
|
||||||
|
|
||||||
|
await bot.api.send_text_message(room.room_id, message)
|
||||||
|
|
||||||
bot.run()
|
bot.run()
|
||||||
|
|
Loading…
Add table
Reference in a new issue