heist.py 文件源码

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

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
def _stats_heist(self, ctx):
        """Shows your Heist stats"""
        author = ctx.message.author
        avatar = ctx.message.author.avatar_url
        settings = self.check_server_settings(author.server)
        self.account_check(settings, author)
        path = settings["Players"][author.id]

        # Theme variables
        sentencing = "{} {}".format(settings["Theme"]["Jail"], settings["Theme"]["Sentence"])
        t_bail = "{} Cost".format(settings["Theme"]["Bail"])

        # Sentence Time Remaining
        sentence = path["Sentence"]
        time_served = path["Time Served"]
        jail_fmt = self.cooldown_calculator(time_served, sentence)

        # Death Time Remaining
        death_timer = path["Death Timer"]
        base_death_timer = settings["Config"]["Death Timer"]
        death_fmt = self.cooldown_calculator(death_timer, base_death_timer)

        rank = self.criminal_level(path["Criminal Level"])

        embed = discord.Embed(colour=0x0066FF, description=rank)
        embed.title = author.name
        embed.set_thumbnail(url=avatar)
        embed.add_field(name="Status", value=path["Status"])
        embed.add_field(name="Spree", value=path["Spree"])
        embed.add_field(name=t_bail, value=path["Bail Cost"])
        embed.add_field(name=settings["Theme"]["OOB"], value=path["OOB"])
        embed.add_field(name=sentencing, value=jail_fmt)
        embed.add_field(name="Apprehended", value=path["Jail Counter"])
        embed.add_field(name="Death Timer", value=death_fmt)
        embed.add_field(name="Total Deaths", value=path["Deaths"])
        embed.add_field(name="Lifetime Apprehensions", value=path["Total Jail"])

        await self.bot.say(embed=embed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号