From 1ed7826e21222f370e8d2c1b3405818ee13b9734 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 1 Dec 2016 20:07:02 +0100 Subject: added legacy 'play' role support --- main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) -- cgit v1.3.1