From 55344487c4889c51edb6209657f6ffbb1799c919 Mon Sep 17 00:00:00 2001 From: NatrixAeria Date: Tue, 20 Oct 2020 03:52:05 +0200 Subject: Fix wrong category --- bot.py | 7 ++++--- commands.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 71635cb..22ebbe6 100644 --- a/bot.py +++ b/bot.py @@ -67,7 +67,7 @@ class Cupido(commands.Bot): async def create_voice_channel(self, ctx, name, category=None): channel = await ctx.guild.create_voice_channel( name, - category=self.meta_channel, + category=category, ) await channel.set_permissions(ctx.guild.default_role, **config.CHANNEL_PERMISSIONS) await channel.set_permissions(self.user, **config.BOT_PERMISSIONS) @@ -159,11 +159,12 @@ class Cupido(commands.Bot): futures.append(self.create_voice_channel(ctx, str(i), category=meta_channel)) return await await_n(futures) - async def get_channels(self, ctx): + async def get_channels(self, ctx, msg=True): meta_channel = self.get_meta_channel(ctx) lobby_channel = self.get_lobby_channel(ctx, meta_channel) if meta_channel is None or lobby_channel is None: - await answer(ctx, 'error: cannot start shuffling, you need to initialize channels') + if msg: + await answer(ctx, 'error: cannot start shuffling, you need to initialize channels') return None return meta_channel, lobby_channel diff --git a/commands.py b/commands.py index 44bc340..7ef8d7b 100644 --- a/commands.py +++ b/commands.py @@ -129,7 +129,7 @@ async def shuffle(ctx: commands.Context, channel_size=2): @commands.command(help='move everyone back to lobby', aliases=('quit', 'exit', 'abort', 'back', 'return')) async def stop(ctx: commands.Context, cancel_loop=True): if not is_admin_channel(ctx): return - channels = await ctx.bot.get_channels(ctx) + channels = await ctx.bot.get_channels(ctx, msg=False) if not channels: return meta_channel, lobby_channel = channels -- cgit v1.2.3