summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-12-01 20:07:02 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2016-12-01 20:07:02 +0100
commit1ed7826e21222f370e8d2c1b3405818ee13b9734 (patch)
tree6e4b178109bbfc5f3ffbd1bbd67e9b4c620c71db
parent31c3e0d00418fae31517e49784ad416761e3335b (diff)
downloadVainbot-1ed7826e21222f370e8d2c1b3405818ee13b9734.tar.gz
Vainbot-1ed7826e21222f370e8d2c1b3405818ee13b9734.zip
added legacy 'play' role support
-rw-r--r--main.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/main.py b/main.py
index 81eb62e..29bd6ef 100644
--- a/main.py
+++ b/main.py
@@ -108,5 +108,22 @@ async def on_message(message):
db.playwithme.remove({"player": message.author.id})
await cli.send_message(message.channel, "Canceled all notifications.")
+ #
+ # "play" role Discoid backwards compatibility
+ #
+ if msg.startswith("\\getrole play"):
+ # toggles the "play" role
+ print("toggled " + message.author.name + "'s play role")
+ for role in message.author.roles:
+ if role.name == "play":
+ await cli.remove_roles(message.author, role)
+ await cli.send_message(message.channel, "Removed the 'play' role.")
+ return
+
+ for role in message.server.roles:
+ if role.name == "play":
+ await cli.add_roles(message.author, role)
+ await cli.send_message(message.channel, "Added the 'play' role.")
+
threading.Timer(10 * 60, cleanup).start()
cli.run(TOKEN)