stars.py 文件源码

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

项目:jose 作者: lnmds 项目源码 文件源码
def starrers(self, ctx, message_id: int):
        """Get the list of starrers from a message in the current channel."""
        try:
            message = await ctx.channel.get_message(message_id)
        except discord.NotFound:
            return await ctx.send('Message not found')
        except discord.Forbidden:
            return await ctx.send("Can't retrieve message")
        except discord.HTTPException as err:
            return await ctx.send(f'Failed to retrieve message: {err!r}')

        guild = ctx.guild
        await self._get_starconfig(guild.id)
        star = await self.get_star(guild.id, message.id)
        if star is None:
            return await ctx.send('Star object not found')

        _, em = make_star_embed(star, message)
        starrers = [guild.get_member(starrer_id)
                    for starrer_id in star['starrers']]

        em.add_field(name='Starrers', value=', '.join([m.display_name
                                                       for m in starrers]))
        await ctx.send(embed=em)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号