stars.py 文件源码

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

项目:jose 作者: lnmds 项目源码 文件源码
def streload(self, ctx, message_id: int):
        """Star reload.

        Reload a message, its starrers and update the star in the starboard.
        Useful if the starred message was edited.
        """
        channel = ctx.channel
        cfg = await self._get_starconfig(channel.guild.id)

        try:
            message = await channel.get_message(message_id)
        except discord.NotFound:
            raise self.SayException('message not found')

        star = await self.get_star(ctx.guild.id, message_id)
        if star is None:
            raise self.SayException('star object not found')

        try:
            await self.update_star(cfg, star, msg=message)
        except StarError as err:
            log.error(f'force_reload: {err!r}')
            raise self.SayException(f'rip {err!r}')

        await ctx.ok()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号