def quote(self, ctx):
"""Get a message from either the current channel or a specified channel.
**Usage:** `g_quote [channel id] <message id>`
**Permission:** User"""
umsg = ctx.message.content
args = umsg.split(' ')
if '--s' in umsg:
await ctx.message.delete()
if len(args) > 1:
try:
if len(args) > 2:
channel = self.bot.get_channel(int(args[1]))
msg = await channel.get_message(int(args[2]))
else:
channel = ctx.message.channel
msg = await channel.get_message(int(args[1]))
em = discord.Embed(title="Found message!",description=msg.content,color=self.randomColour())
em.set_footer(text='Author: {}'.format(str(msg.author)))
em.timestamp = msg.created_at
await ctx.send(embed=em)
except ValueError:
await ctx.send(":x: Please enter an id (or multiple) to find a message.")
except discord.NotFound:
await ctx.send(":x: I'm sorry, but I couldn't find that message. :sob:")
else:
await ctx.send("Improper arguments.")
评论列表
文章目录