dotastats.py 文件源码

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

项目:MangoByte 作者: mdiller 项目源码 文件源码
def opendota(self, ctx, *, query):
        """Queries the opendota api

        You can use this to get a json file with details about players or matches etc.
        Examples:
        `{cmdpfx}opendota /players/{steamid}`
        `{cmdpfx}opendota /matches/{match_id}`

        For more options and a better explanation, check out their [documentation](https://docs.opendota.com)"""
        query = query.replace("/", " ")
        query = query.strip()
        query = "/" + "/".join(query.split(" "))

        with ctx.channel.typing():
            data = await opendota_query(query)

        filename = re.search("/([/0-9a-zA-Z]+)", query).group(1).replace("/", "_")
        filename = settings.resource(f"temp/{filename}.json")
        write_json(filename, data)
        await ctx.send(file=discord.File(filename))
        os.remove(filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号