MCPcopy
hub / github.com/OpenWebGAL/WebGAL / callSteam

Function callSteam

packages/webgal/src/Core/gameScripts/callSteam.ts:11–28  ·  view source on GitHub ↗
(sentence: ISentence)

Source from the content-addressed store, hash-verified

9 * The script expects the first positional parameter to be the achievement id.
10 */
11export 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};

Callers

nothing calls this directly

Calls 3

getStringArgByKeyFunction · 0.90
createNonePerformFunction · 0.90
unlockAchievementMethod · 0.80

Tested by

no test coverage detected