Esempio n. 1
0
    def bot_medical(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:
            medical = EFT.check_medical(lang, data)
            embed = discord.Embed(
                title=medical.name,
                url=medical.wikiLink,
                description=medical.description,
                color=0x780A81,
            )
            embed.set_thumbnail(
                url="https://static.tarkov-database.com/image/icon/1-1/{0}.png"
                .format(medical.bsgID))
            embed.add_field(
                name=localized_string(lang, "medUseTime"),
                value=medical.useTime,
                inline=True,
            )
            embed.add_field(
                name=localized_string(lang, "maxItemHP"),
                value=medical.resources,
                inline=True,
            )
            embed.add_field(
                name=localized_string(lang, "maxHealPerUse"),
                value=medical.resourceRate,
                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 medical item ; please try again.",
                inline=True,
            )
            return embed
Esempio n. 2
0
 def bot_medical(self, ctx: CommandContext, data: str) -> str:
     log.info("%s - searching for %s\n", ctx.channel, data)
     lang = self.db.get_lang(ctx.channel)
     try:
         medical = EFT.check_medical(lang, data)
         return localized_string(
             lang,
             "twitch_medical",
             medical.name,
             medical.useTime,
             medical.resources,
             medical.resourceRate,
         )
     except:
         return localized_string(
             lang,
             "searchFailed",
         )