mod.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
def raid_off(self, ctx):
        """Disables raid mode on the server.

        When disabled, the server verification levels are set
        back to Low levels and the bot will stop broadcasting
        join messages.
        """

        try:
            await ctx.guild.edit(verification_level=discord.VerificationLevel.low)
        except discord.HTTPException:
            await ctx.send('\N{WARNING SIGN} Could not set verification level.')

        query = """INSERT INTO guild_mod_config (id, raid_mode, broadcast_channel)
                   VALUES ($1, $2, NULL) ON CONFLICT (id)
                   DO UPDATE SET
                        raid_mode = EXCLUDED.raid_mode,
                        broadcast_channel = NULL;
                """

        await ctx.db.execute(query, ctx.guild.id, RaidMode.off.value)
        self._recently_kicked.pop(ctx.guild.id, None)
        await ctx.send('Raid mode disabled. No longer broadcasting join messages.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号