welcome.py 文件源码

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

项目:Dumb-Cogs 作者: irdumbs 项目源码 文件源码
def channel(self, ctx, channel : discord.Channel=None):
        """Sets the channel to send the welcome message

        If channel isn't specified, the server's default channel will be used"""
        server = ctx.message.server
        if channel is None:
            channel = ctx.message.server.default_channel
        if not server.get_member(self.bot.user.id
                                 ).permissions_in(channel).send_messages:
            await self.bot.say("I do not have permissions to send "
                               "messages to {0.mention}".format(channel))
            return
        self.settings[server.id]["CHANNEL"] = channel.id
        dataIO.save_json(settings_path, self.settings)
        channel = self.get_welcome_channel(server)
        await self.bot.send_message(channel, "I will now send welcome "
                                    "messages to {0.mention}".format(channel))
        await self.send_testing_msg(ctx)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号