(sentence: ISentence)
| 9 | * The script expects the first positional parameter to be the achievement id. |
| 10 | */ |
| 11 | export const callSteam = (sentence: ISentence): IPerform => { |
| 12 | for (const arg of sentence.args) { |
| 13 | if (arg.key === 'achievementId') { |
| 14 | const achievementId = getStringArgByKey(sentence, 'achievementId'); |
| 15 | if (achievementId) { |
| 16 | WebGAL.steam |
| 17 | .unlockAchievement(achievementId) |
| 18 | .then((result) => { |
| 19 | logger.info(`callSteam: achievement ${achievementId} unlock ${result ? 'succeeded' : 'failed'}`); |
| 20 | }) |
| 21 | .catch((error) => { |
| 22 | logger.error(`callSteam: achievement ${achievementId} unlock threw`, error); |
| 23 | }); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | return createNonePerform(); |
| 28 | }; |
nothing calls this directly
no test coverage detected