voice.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Excalibot 作者: endreman0 项目源码 文件源码
def link(self, ctx, text: discord.TextChannel, *, voice: discord.VoiceChannel):
        """Links an existing text channel to a voice channel."""
        with ctx.session:
            link = ctx.session.get(TextVoiceLink, text_id=text.id, voice_id=voice.id).one_or_none()
            if link is not None:
                return await ctx.send('BAKA! Those channels are already linked!')
            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='Linked {} to "{}"'.format(text.mention, voice.name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号