Funstuff.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Luna 作者: Moonlington 项目源码 文件源码
def quote(self, ctx, qid, *, content=None):
        if content is None:
            msg = await self.bot.get_message(ctx.message.channel, qid)
            if msg is None:
                await self.bot.say("Message with that ID not found! (Or you used a user ID which you shouldn't use without content)")
            else:
                em = discord.Embed(description=msg.content, colour=msg.author.color)
                em.set_author(name=str(msg.author), icon_url=msg.author.avatar_url)
                em.set_footer(text="Sent | {}".format(msg.timestamp))
                await self.bot.send_message(ctx.message.channel, embed=em)
        else:
            mem = ctx.message.server.get_member(qid)
            if mem is None:
                await self.bot.say("Member with that ID not found! (Or you used a message ID which you shouldn't use)")
            else:
                em = discord.Embed(description=content, colour=mem.color)
                em.set_author(name=mem.display_name, icon_url=mem.avatar_url)
                em.set_footer(text="Sent | {}".format(random.choice(["Sometime...", "in a whisper.", "in hell"])))
                await self.bot.send_message(ctx.message.channel, embed=em)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号