osu.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号