noahcoolboy / funcaptcha

A library used to interact with funcaptchas.
Other
186 stars 43 forks source link

Add string_table property to challenges #9

Closed sv-du closed 2 years ago

sv-du commented 2 years ago

Hello, I'm requesting that you add the string_table property in challenges, as it appears like there's a property like that in the challenge pastebin that you provide. Either that, or a method that converts a game_variant to an objective

noahcoolboy commented 2 years ago

Hello again The pastebin which I provided is an example of what you can find in the Challenge.data object Meaning that, the string_table is accessible using Challenge.data.string_table If you would like the instruction string, you can use

challenge.data.string_table[`${challenge.data.game_data.gameType}.instructions-${challenge.data.game_data.game_variant}`]
sv-du commented 2 years ago

That's the thing, when I tried to access it, I got the following error Property 'string_table' does not exist on type 'ChallengeData'

noahcoolboy commented 2 years ago

Ah, are you using TypeScript by any chance? I only partially implemented the data object into the ChallengeData interface which may cause this error. I believe you can tell typescript to ignore the next line using // @ts-ignore I will add it eventually.

sv-du commented 2 years ago

Yea I'm using Typescript, and I thought doing // @ts-ignore does that for the whole file, no?

noahcoolboy commented 2 years ago

// @ts-ignore only ignores the next line, while // @ts-nocheck does it for the whole file At least that's what I think

noahcoolboy commented 2 years ago

The properties have been added As a bonus, there is now an instruction accessor in the Challenge class which will directly give you the instruction string