Skip to content

Commit e096ab4

Browse files
authored
fix: properly export the quest commands (#334)
* fix: properly export the quest commands * fix: add to mock interface
1 parent e681715 commit e096ab4

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {Command} from '../generated/schemas';
2+
import {schemaCommandFactory} from '../utils/commandFactory';
3+
4+
export const getQuestEnrollmentStatus = schemaCommandFactory(Command.GET_QUEST_ENROLLMENT_STATUS);

src/commands/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import {getInstanceConnectedParticipants} from './getInstanceConnectedParticipan
2424
import {getRelationships} from './getRelationships';
2525
import {inviteUserEmbedded} from './inviteUserEmbedded';
2626
import {getUser} from './getUser';
27+
import {getQuestEnrollmentStatus} from './getQuestEnrollmentStatus';
28+
import {questStartTimer} from './questStartTimer';
2729

2830
export {Commands, SetActivity};
2931

@@ -52,6 +54,8 @@ function commands(sendCommand: TSendCommand) {
5254
getRelationships: getRelationships(sendCommand),
5355
inviteUserEmbedded: inviteUserEmbedded(sendCommand),
5456
getUser: getUser(sendCommand),
57+
getQuestEnrollmentStatus: getQuestEnrollmentStatus(sendCommand),
58+
questStartTimer: questStartTimer(sendCommand),
5559
};
5660
}
5761

src/commands/questStartTimer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {Command} from '../generated/schemas';
2+
import {schemaCommandFactory} from '../utils/commandFactory';
3+
4+
export const questStartTimer = schemaCommandFactory(Command.QUEST_START_TIMER);

src/mock.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,11 @@ export const commandsMockDefault: IDiscordSDK['commands'] = {
192192
avatar: null,
193193
});
194194
},
195+
getQuestEnrollmentStatus: () =>
196+
Promise.resolve({
197+
quest_id: 'mock_quest_id',
198+
is_enrolled: false,
199+
enrolled_at: null,
200+
}),
201+
questStartTimer: () => Promise.resolve({success: true}),
195202
};

0 commit comments

Comments
 (0)