portal.py 文件源码

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

项目:Excalibot 作者: endreman0 项目源码 文件源码
def connect(self, ctx, channel):
        me, channel_name = (channel.me, '%s\'s DMs' % channel.recipient) if isinstance(channel, discord.DMChannel) else (channel.guild.me, channel.name)
        if channel is None:
            await ctx.send('BAKA! I can\'t access that channel!')
            return
        elif channel.permissions_for(me).send_messages is False:
            await ctx.send('BAKA! I can\'t speak in that channel!')
            return
        await ctx.send('Connecting to %s' % channel_name)

        portal_key = (ctx.author, ctx.channel)
        self.portals[portal_key] = channel
        return portal_key
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号