예제 #1
0
 def bot_helmet(self, ctx: CommandContext, data: str) -> str:
     log.info("%s - searching for %s\n", ctx.channel, data)
     lang = self.db.get_lang(ctx.channel)
     try:
         helmet = EFT.check_helmets(lang, data)
         return localized_string(
             lang,
             "twitch_helmet",
             helmet.name,
             helmet.armorClass,
             helmet.armorDurability,
             helmet.armorRico,
             helmet.armorZones,
         )
     except:
         return localized_string(
             lang,
             "searchFailed",
         )
예제 #2
0
 def bot_helmetstats(self, ctx: CommandContext, data: str) -> str:
     log.info("%s - searching for %s\n", ctx.channel, data)
     lang = self.db.get_lang(ctx.channel)
     try:
         helmet = EFT.check_helmets(lang, data)
         return localized_string(
             lang,
             "twitch_helmetstats",
             helmet.name,
             helmet.armorMoveSpeed,
             helmet.armorTurnSpeed,
             helmet.armorErgo,
             helmet.helmetSoundReduc,
             helmet.helmetBlocksHeadset,
         )
     except:
         return localized_string(
             lang,
             "searchFailed",
         )
예제 #3
0
 def bot_helmet(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:
         helmet = EFT.check_helmets(lang, data)
         embed = discord.Embed(
             title=helmet.name,
             url=helmet.wikiLink,
             description=helmet.description,
             color=0x780A81,
         )
         embed.set_thumbnail(
             url="https://static.tarkov-database.com/image/icon/1-1/{0}.png"
             .format(helmet.bsgID))
         embed.add_field(
             name=localized_string(lang, "helmetZones"),
             value=helmet.armorZones,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetClass"),
             value=helmet.armorClass,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetDurability"),
             value=helmet.armorDurability,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetRicochet"),
             value=helmet.armorRico,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetMoveSpeed"),
             value=helmet.armorMoveSpeed,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetTurnSpeed"),
             value=helmet.armorTurnSpeed,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetErgo"),
             value=helmet.armorErgo,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetSoundReduc"),
             value=helmet.helmetSoundReduc,
             inline=True,
         )
         embed.add_field(
             name=localized_string(lang, "helmetBlocksHeadset"),
             value=helmet.helmetBlocksHeadset,
             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 helmet item ; please try again.",
             inline=True,
         )
         return embed