utils.py 文件源码

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

项目:GAFBot 作者: DiNitride 项目源码 文件源码
def whois(self, ctx, user_id: int):
        """
        Searches for a user via ID
        """
        try:
            with ctx.channel.typing():
                user = await self.bot.get_user_info(user_id)
                embed = discord.Embed(colour=discord.Colour(0x30f9c7), description="ID: {}".format(user.id),
                                      timestamp=datetime.datetime.now())
                embed.set_thumbnail(
                    url=user.avatar_url)
                embed.set_author(name=user)
                embed.set_footer(text="Who Is: User")
                embed.add_field(name="Bot?", value=user.bot, inline=False)
                embed.add_field(name="Account Creation Date", value=user.created_at, inline=False)
                await ctx.send(embed=embed)
        except discord.NotFound:
            await ctx.send("`No user found under this ID`")
        except discord.HTTPException:
            await ctx.send("`Error collecting user information`")
            return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号