def gamemode(message: discord.Message, mode: api.GameMode.get_mode):
""" Sets the command executor's gamemode.
Gamemodes are: `{modes}`. """
assert message.author.id in osu_config.data["profiles"], \
"No osu! profile assigned to **{}**!".format(message.author.name)
user_id = osu_config.data["profiles"][message.author.id]
assert await has_enough_pp(u=user_id, m=mode.value, type="id"), \
"**Your pp in {} is less than the required {}pp.**".format(mode.name, minimum_pp_required)
osu_config.data["mode"][message.author.id] = mode.value
osu_config.save()
# Clear the scores when changing mode
if message.author.id in osu_tracking:
del osu_tracking[message.author.id]
await client.say(message, "Set your gamemode to **{}**.".format(mode.name))
评论列表
文章目录