def _filter(self, ctx):
"""Adds/removes words from filter
Use double quotes to add/remove sentences
Using this command with no subcommands will send
the list of the server's filtered words."""
if ctx.invoked_subcommand is None:
await send_cmd_help(ctx)
server = ctx.message.server
author = ctx.message.author
if server.id in self.filter:
if self.filter[server.id]:
words = ", ".join(self.filter[server.id])
words = "Filtered in this server:\n\n" + words
try:
for page in pagify(words, delims=[" ", "\n"], shorten_by=8):
await self.bot.send_message(author, page)
except discord.Forbidden:
await self.bot.say("I can't send direct messages to you.")
评论列表
文章目录