mod.py 文件源码

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

项目:LunaBot 作者: miraai 项目源码 文件源码
def pinmsgdate(self, ctx, date: date, *, channel: discord.Channel = None):
        """Pins an old message from a specific date.

        If a channel is not given, then pins from the channel the
        command was ran on.

        The format of the date must be either YYYY-MM-DD or YYYY/MM/DD.
        """

        if channel is None:
            channel = ctx.message.channel

        async for m in self.bot.logs_from(channel, after=date, limit=1):
            try:
                await self.bot.pin_message(m)
            except:
                await self.bot.say('**Error!** Could not pin message.')
            else:
                await self.bot.say('**Done!** Successfully pinned message.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号