def rotmg_characters(self, ctx, player : str):
'''Realm of the Mad God player characters information'''
url = "https://nightfirec.at/realmeye-api/?player={}".format(player)
# http://webhost.ischool.uw.edu/~joatwood/realmeye_api/0.3/
async with clients.aiohttp_session.get(url) as resp:
data = await resp.json()
if "error" in data:
await self.bot.embed_reply("Error: " + data["error"])
return
embed = discord.Embed(title = "{}'s Characters".format(data["player"]), 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)
for character in data["characters"]:
value = "Fame: {0[fame]:,}, Exp: {0[exp]:,}, Rank: {0[place]:,}, Class Quests Completed: {0[cqc]}, Stats Maxed: {0[stats_maxed]}".format(character)
value += "\nHP: {0[hp]}, MP: {0[mp]}, Attack: {0[attack]}, Defense: {0[defense]}, Speed: {0[speed]}, Vitality: {0[vitality]}, Wisdom: {0[wisdom]}, Dexterity: {0[dexterity]}".format(character["stats"])
equips = []
for type, equip in character["equips"].items():
equips.append("{}: {}".format(type.capitalize(), equip))
value += '\n' + ", ".join(equips)
value += "\nPet: {0[pet]}, Clothing Dye: {0[character_dyes][clothing_dye]}, Accessory Dye: {0[character_dyes][accessory_dye]}, Backpack: {0[backpack]}".format(character)
value += "\nLast Seen: {0[last_seen]}, Last Server: {0[last_server]}".format(character)
embed.add_field(name = "Level {0[level]} {0[class]}".format(character), value = value, inline = False)
await self.bot.say(embed = embed)
评论列表
文章目录