pokedex.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
def assert_type(slot: str, server: discord.Server):
    """ Assert if a type does not exist, and show the valid types. """
    match = get_close_matches(slot, api["types"], n=1, cutoff=0.4)

    if match:
        matches_string = " Perhaps you meant `{}`?".format(match[0])
    else:
        matches_string = " See `{}help pokedex type`.".format(server_command_prefix(server))
    assert slot in api["types"], "**{}** is not a valid pokemon type.{}".format(
        slot.capitalize(), matches_string)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号