def quote(self, ctx, *, author_or_num: str = None):
"""Say a stored quote!
Without any arguments, this command randomly selects from all stored
quotes. If you supply an author name, it randomly selects from among
that author's quotes. Finally, if given a number, that specific quote
will be said, assuming it exists. Use [p]lsquotes to show all quotes.
"""
sid = ctx.message.server.id
if sid not in self.quotes or len(self.quotes[sid]) == 0:
await self.bot.say("There are no quotes in this server!")
return
try:
quote = self._get_quote(ctx, author_or_num)
except commands.BadArgument:
if author_or_num.lower().strip() in ['me', 'myself', 'self']:
quote = self._get_quote(ctx, ctx.message.author)
else:
raise
await self.bot.say(self._format_quote(ctx, quote))
评论列表
文章目录