summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatrixAeria <upezu@student.kit.edu>2020-10-20 03:52:05 +0200
committerNatrixAeria <upezu@student.kit.edu>2020-10-20 03:52:05 +0200
commit55344487c4889c51edb6209657f6ffbb1799c919 (patch)
tree4870c429d447c164e77b901f9f62e03124710a95
parentd25246962ff3ae1d269411e8ceb4ba4f539405d5 (diff)
Fix wrong category
-rw-r--r--bot.py7
-rw-r--r--commands.py2
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