From 7748a54d3c9fe0a3dfc4287d9d27d85fc6db975d Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Tue, 14 Apr 2020 17:51:04 -0700 Subject: [PATCH] invites now link to whatever voice channel you are in when you run the command. if not in a voice channel, it goes to the channel the command was run in --- app/dragon-bot.py | 5 ++++- app/help_methods.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/dragon-bot.py b/app/dragon-bot.py index 9e2bd309..4baff0d0 100644 --- a/app/dragon-bot.py +++ b/app/dragon-bot.py @@ -248,8 +248,11 @@ async def on_message(message): if message.content.startswith('!invite'): # 3600 = 1 hour + invite_channel = message.channel + if message.author.voice.voice_channel: + invite_channel = message.author.voice.voice_channel invite = await client.create_invite( - destination=message.channel, max_uses=1, max_age=3600 + destination=invite_channel, max_uses=1, max_age=3600 ) await client.send_message(message.channel, invite) diff --git a/app/help_methods.py b/app/help_methods.py index 8098bc9f..ae488009 100644 --- a/app/help_methods.py +++ b/app/help_methods.py @@ -74,8 +74,8 @@ def get_help_message(method): 'Shows you this message' ], 'invite': [ - 'Generates a one time use invite to the current channel.', - 'Be quick! It expires in 12 hours' + 'Generates a one time use invite to the voice channel you are currently in.\n', + 'if you are not in a voice channel, the invite will be for whatever channel !invite was typed in.\n', ], 'issue': [ 'Creates an issue on gitlab with the passed in parameters\n',