def _item_pokemon(self, *, item_name: str):
"""Search for an item in the Pokémon universe
Args:
item_name: variable length string
Returns:
Discord embed
Raises:
AttributeError: Item not found
Examples:
pokemon item master ball
"""
item = self.search_csv(item_name.title(), 'data/pokedex/Items.csv', data_type='i')
try:
color = self.color_lookup(item.category)
except AttributeError:
await self.bot.say("An item with that name could not be found.")
else:
embed = discord.Embed(colour=color, title=item.name)
embed.set_thumbnail(url=item.image)
embed.add_field(name="Cost", value=item.cost)
embed.add_field(name="Category", value=item.category)
embed.add_field(name="Effect", value=item.effect)
await self.bot.say(embed=embed)
评论列表
文章目录