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)
评论列表
文章目录