def _signup_lottery(self, ctx):
"""Signs you up to track lottery stats.
You must have the required role to sign-up for stat tracking.
If you lose the role, or it changes your stats will still be tracked
and the information can be viewed when you get the role again.
By default, anyone can sign up.
"""
author = ctx.message.author
settings = self.check_server_settings(author.server)
if author.id in settings["Members"]:
return await self.bot.say("You are already signed-up to track stats.")
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 track stats.")
settings["Members"][author.id] = {"Name": author.name, "Entries": 0, "Won": 0}
self.save_system()
await self.bot.say("Congratulations {}, you can now start tracking your lottery stats. "
"To view your stats use the command "
"{}lottery stats.".format(author.name, ctx.prefix))
评论列表
文章目录