mod.py 文件源码

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

项目:Bonfire 作者: Phxntxm 项目源码 文件源码
def notifications(self, ctx, channel: discord.Channel):
        """This command is used to set a channel as the server's 'notifications' channel
        Any notifications (like someone going live on Twitch, or Picarto) will go to that channel
        EXAMPLE: !alerts #alerts
        RESULT: No more alerts spammed in #general!"""
        if str(channel.type) != "text":
            await self.bot.say("The notifications channel must be a text channel!")
            return

        key = ctx.message.server.id
        entry = {'server_id': key,
                 'notification_channel': channel.id}
        if not await utils.update_content('server_settings', entry, key):
            await utils.add_content('server_settings', entry)
        await self.bot.say("I have just changed this server's 'notifications' channel"
                           "\nAll notifications will now go to `{}`".format(channel))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号