From 495b71413546f2f54b37af3ed01b730b9e155a89 Mon Sep 17 00:00:00 2001 From: Sleepingpirates Date: Fri, 12 Jun 2020 17:26:26 +0000 Subject: [PATCH] fixed bugs --- Docker/Invitarr-docker.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Docker/Invitarr-docker.py b/Docker/Invitarr-docker.py index c76651f..0de6e6e 100644 --- a/Docker/Invitarr-docker.py +++ b/Docker/Invitarr-docker.py @@ -63,6 +63,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.') @@ -82,7 +83,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.') @@ -95,7 +95,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.") @@ -120,7 +119,6 @@ class MyClient(discord.Client): user_id = user_id.replace(i, '') db.save_user(user_id, email) await message.channel.send('The user has been added to db!') - secure = client.get_channel(chan) await secure.send(email + ' ' + msg[1] + ' was added to plex') except: await message.channel.send('Cannot add this user to db.')