def _add_quote(self, ctx, author, message):
sid = ctx.message.server.id
aid = ctx.message.author.id
if sid not in self.quotes:
self.quotes[sid] = []
author_name = 'Unknown'
author_id = None
if isinstance(author, discord.User):
author_name = author.display_name
author_id = author.id
elif isinstance(author, str):
author_name = author
quote = {'added_by': aid,
'author_name': author_name,
'author_id': author_id,
'text': escape_mass_mentions(message)}
self.quotes[sid].append(quote)
dataIO.save_json(JSON, self.quotes)
评论列表
文章目录