General.py 文件源码

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

项目:youtube 作者: FishyFing 项目源码 文件源码
def info(self, ctx):
        """Information about the bot"""
        msg = await ctx.send('Getting statistics...')
        shards = self.bot.shard_count
        shard_id = ctx.message.guild.shard_id
        guilds = len(list(self.bot.guilds))
        users = str(len([m for m in set(self.bot.get_all_members())]))

        channels = str(len([m for m in set(self.bot.get_all_channels())]))
        # await msg.edit("Getting uptime...")
        up = abs(self.bot.uptime - int(time.perf_counter()))
        up = str(datetime.timedelta(seconds=up))

        data = discord.Embed(title="__**Information**__",
                             colour=discord.Colour(value=11735575))
        data.add_field(name="Version", value="2.5-beta", inline=False)
        data.add_field(name="Shard ID", value=ctx.message.guild.shard_id)
        data.add_field(name="Total Shards", value=shards)
        data.add_field(name="Total Servers", value=guilds)
        # data.add_field(name="Servers (total)", value=total_guilds)
        data.add_field(name="Users", value=users)
        data.add_field(name="Channels", value=channels)
        data.add_field(name="Uptime", value="{}".format(up))
        data.add_field(name="Support Development",
                       value="Donate on [Patreon](https://www.patreon.com/franc_ist) or [PayPal](https://paypal.me/MLAutomod/5)")
        data.set_footer(
            text="Made with \U00002665 by Francis#6565. Support server: https://discord.gg/yp8WpMh")
        try:
            await msg.edit(content=None, embed=data)
            statsd.increment('bot.commands.run', 1)
        except discord.HTTPException:
            logger.exception("Missing embed links perms")
            statsd.increment('bot.commands.errored', 1)
            await ctx.send("Looks like the bot doesn't have embed links perms... It kinda needs these, so I'd suggest adding them!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号