From 0bc6cfce0b217a1493ccbbb8fc9198c9312be7f4 Mon Sep 17 00:00:00 2001 From: Sleepingpirates Date: Fri, 12 Jun 2020 17:28:19 +0000 Subject: [PATCH] fixed bugs --- Invitarr.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Invitarr.py b/Invitarr.py index 1303f83..872a064 100644 --- a/Invitarr.py +++ b/Invitarr.py @@ -65,6 +65,7 @@ class MyClient(discord.Client): async def on_member_update(self, before, after): role = after.guild.get_role(roleid) + secure = client.get_channel(chan) if (role in after.roles and role not in before.roles): await after.send('Welcome To '+ PLEX_SERVER_NAME +'. Just reply with your email so we can add you to Plex!') await after.send('I will wait 10 minutes for your message, if you do not send it by then I will cancel the command.') @@ -84,7 +85,6 @@ class MyClient(discord.Client): db.save_user(str(after.id), email.content) await asyncio.sleep(20) await after.send('You have Been Added To Plex!') - secure = client.get_channel(chan) await secure.send(plexname + ' ' + after.mention + ' was added to plex') else: await after.send('There was an error adding this email address. Message Server Admin.') @@ -97,7 +97,6 @@ class MyClient(discord.Client): deleted = db.delete_user(user_id) if deleted: print("Removed {} from db".format(email)) - secure = client.get_channel(chan) await secure.send(plexname + ' ' + after.mention + ' was removed from plex') else: print("Cannot remove this user from db.") @@ -143,8 +142,6 @@ class MyClient(discord.Client): else: message.channel.send('Error Check Logs! {0.author.mention}'.format(message)) - - async def on_member_remove(self, member): if auto_remove_user: @@ -161,11 +158,6 @@ class MyClient(discord.Client): print("Cannot remove this user from db.") except: print("Cannot remove this user from plex.") - - def printdb(): - - - client = MyClient() client.run(Discord_bot_token) \ No newline at end of file