def make(self, ctx, *, voice: discord.VoiceChannel):
"""Creates a text channel and links it to the given voice channel."""
msg = await ctx.send('Creating text channel for {}'.format(voice.name))
text = await ctx.guild.create_text_channel('voice-' + voice.name.lower().replace(' ', '-'), reason='Voice link requested by {}'.format(ctx.author))
with ctx.session:
role = await self._create_role(ctx.guild, text, voice, 'Voice link requested by {}'.format(ctx.author))
link = ctx.session.add(TextVoiceLink(role_id=role.id, text_id=text.id, voice_id=voice.id))
await ctx.send(content='Created {} and linked it to "{}"'.format(text.mention, voice.name))
评论列表
文章目录