1const djinn = require('djinn')('telegram_app_id');
2
3const quests = await djinn.getAvailableQuests();
4
5{quests.map(quest => (
6 <div>
7 {quest.title}
8 <button onClick={() => djinn.startQuest(quest.id, telegramUserId)}>{quest.action}</button>
9 </div>
10)}
1const djinn = require('djinn_sdk')('telegram_app_id');
2
3const questStatus = await djinn.getQuestStatus('quest_id', 'telegram_user_id');
4
5if (QUEST_STATUS.SUCCESS !== questStatus) {
6 reject('telegram_user_id');
7}
8sendReward('telegram_user_id')
1const djinn = require('djinn_sdk')('telegram_app_id');
2
3const userQuests = await djinn.getUserQuests('telegram_user_id');
4
5
6{userQuests.map(userQuest => (
7 <div>
8 <div>{quest.name}</div>
9 <div>{quest.description}</div>
10 <div>Status : {quest.status}</div>
11 {quest.status !== QUEST_STATUS.SUCCESS && (
12 <button onClick={() => djinn.startQuest(quest.id, telegramUserId)}>{quest.action}</button>
13 )
14 </div>
15)}