def runescape_monster(self, ctx, *, monster : str):
'''Runescape bestiary'''
url = "http://services.runescape.com/m=itemdb_rs/bestiary/beastSearch.json?term={}".format(monster.replace(' ', '+'))
async with clients.aiohttp_session.get(url) as resp:
data = await resp.json()
if data[0] == "none":
await self.bot.embed_reply(":no_entry: Monster not found")
return
url = "http://services.runescape.com/m=itemdb_rs/bestiary/beastData.json?beastid={}".format(data[0]["value"])
async with clients.aiohttp_session.get(url) as resp:
data = await resp.json()
embed = discord.Embed(title = data["name"], description = data["description"], color = clients.bot_color)
avatar = ctx.message.author.avatar_url or ctx.message.author.default_avatar_url
embed.set_author(name = ctx.message.author.display_name, icon_url = avatar)
embed.add_field(name = "Level", value = data["level"])
embed.add_field(name = "Weakness", value = data["weakness"])
embed.add_field(name = "XP/Kill", value = data["xp"])
embed.add_field(name = "Lifepoints", value = data["lifepoints"])
embed.add_field(name = "Members", value = "Yes" if data["members"] else "No")
embed.add_field(name = "Aggressive", value = "Yes" if data["aggressive"] else "No")
await self.bot.say(embed = embed)
# add other? - http://runescape.wikia.com/wiki/RuneScape_Bestiary#beastData
评论列表
文章目录