def _stats_lottery(self, ctx):
"""Shows your lottery stats
Shows the number of times you have entered and the number
of times you have won a lottery."""
author = ctx.message.author
settings = self.check_server_settings(author.server)
if author.id not in settings["Members"]:
return await self.bot.say("You are not a lottery member. Only members can view and "
"track stats. Use [p]lottery signup to join.")
role = settings["Config"]["Role"]
if role not in [r.name for r in author.roles]:
return await self.bot.say("You do not have the required role to view stats.")
played = settings["Members"][author.id]["Entries"]
won = settings["Members"][author.id]["Won"]
embed = discord.Embed(description="Lottery Stat Tracker", color=0x50bdfe)
embed.set_author(name=author.name)
embed.set_thumbnail(url=author.avatar_url)
embed.add_field(name="Entries", value=played, inline=True)
embed.add_field(name="Won", value=won, inline=True)
await self.bot.say(embed=embed)
评论列表
文章目录