def bot_astat(self, ctx: CommandContext, data: str) -> Union[str, discord.Embed]: log.info("%s - searching for %s (new)\n", ctx.channel, data) lang = self.db.get_lang(ctx.channel) try: astat = EFT.check_astat(lang, data) embed = discord.Embed( title=astat.name, url=astat.wikiLink, description=astat.description, color=0x780A81, ) embed.set_thumbnail( url="https://static.tarkov-database.com/image/icon/1-1/{0}.png" .format(astat.bsgID)) embed.add_field( name=localized_string(lang, "ammoFlesh"), value=astat.damage, inline=True, ) embed.add_field( name=localized_string(lang, "ammoPen"), value=astat.penetration, inline=True, ) embed.add_field( name=localized_string(lang, "ammoArmor"), value=astat.armorDamage, inline=True, ) embed.add_field( name=localized_string(lang, "ammoAccuracy"), value=astat.accuracy, inline=True, ) embed.add_field( name=localized_string(lang, "ammoRecoil"), value=astat.recoil, inline=True, ) embed.add_field( name=localized_string(lang, "ammoFrag"), value=astat.fragmentation, inline=True, ) return embed except: embed = discord.Embed( title="LogicEFTBot - Error", color=0x780A81, ) embed.set_thumbnail(url="https://illogical.network/api/error.png") embed.add_field( name="Invalid Item Search", value= "You've entered in an invalid ammo item ; please try again.", inline=True, ) return embed
def bot_astat(self, ctx: CommandContext, data: str) -> str: log.info("%s - searching for %s\n", ctx.channel, data) lang = self.db.get_lang(ctx.channel) try: astat = EFT.check_astat(lang, data) return localized_string( lang, "twitch_astat", astat.name, astat.damage, astat.penetration, ) except: return localized_string( lang, "searchFailed", )