def mentionspam_ignore(self, ctx, *channels: discord.TextChannel):
"""Specifies what channels ignore mentionspam auto-bans.
If a channel is given then that channel will no longer be protected
by auto-banning from mention spammers.
To use this command you must have the Ban Members permission.
"""
query = """UPDATE guild_mod_config
SET safe_mention_channel_ids =
ARRAY(SELECT DISTINCT * FROM unnest(COALESCE(safe_mention_channel_ids, '{}') || $2::bigint[]))
WHERE id = $1;
"""
if len(channels) == 0:
return await ctx.send('Missing channels to ignore.')
channel_ids = [c.id for c in channels]
await ctx.db.execute(query, ctx.guild.id, channel_ids)
self.get_guild_settings.invalidate(self, ctx.guild.id)
await ctx.send(f'Mentions are now ignored on {", ".join(c.mention for c in channels)}.')
评论列表
文章目录