Ejemplo n.º 1
0
 def bot_armor(self, ctx: CommandContext, data: str) -> str:
     log.info("%s - searching for %s\n", ctx.channel, data)
     lang = self.db.get_lang(ctx.channel)
     try:
         armor = EFT.check_armor(lang, data)
         return localized_string(
             lang,
             "twitch_armor",
             armor.armorName,
             armor.armorClass,
             armor.armorDurability,
             armor.armorZones,
         )
     except:
         return localized_string(
             lang,
             "searchFailed",
         )
Ejemplo n.º 2
0
 def bot_armorstats(self, ctx: CommandContext, data: str) -> str:
     log.info("%s - searching for %s\n", ctx.channel, data)
     lang = self.db.get_lang(ctx.channel)
     try:
         armor = EFT.check_armor(lang, data)
         return localized_string(
             lang,
             "twitch_armorstats",
             armor.armorName,
             armor.armorEffectiveDurability,
             armor.armorMoveSpeed,
             armor.armorTurnSpeed,
             armor.armorErgo,
         )
     except Exception as e:
         print(e)
         return localized_string(
             lang,
             "searchFailed",
         )
Ejemplo n.º 3
0
 def bot_armor(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:
         armor = EFT.check_armor(lang, data)
         embed = discord.Embed(
             title=armor.armorName,
             url=armor.wikiLink,
             description=localized_string(lang, "armorZones") +
             armor.armorZones,
             color=0x780A81,
         )
         embed.set_thumbnail(
             url="https://static.tarkov-database.com/image/icon/1-1/{0}.png"
             .format(armor.bsgID))
         embed.add_field(
             name=localized_string(lang, "armorClass"),
             value=armor.armorClass,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "armorMaterial"),
             value=armor.armorMaterial,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "armorDurability"),
             value=armor.armorDurability,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "armorMoveSpeed"),
             value=armor.armorMoveSpeed,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "armorTurnSpeed"),
             value=armor.armorTurnSpeed,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "armorErgo"),
             value=armor.armorErgo,
             inline=True,
         )
         embed.set_footer(
             text=localized_string(lang, "armorEffectiveDurability") +
             armor.armorEffectiveDurability)
         return embed
     except Exception as e:
         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 armor item ; please try again.",
             inline=True,
         )
         print(e)
         return embed