mirror of
https://github.com/Sneed-Group/clanrocket-2
synced 2025-01-09 17:53:13 +00:00
Update 'index.js'
This commit is contained in:
parent
2a14cc3744
commit
017c6749c9
1 changed files with 206 additions and 206 deletions
8
index.js
8
index.js
|
@ -192,10 +192,10 @@ client.on('interactionCreate', async interaction => {
|
|||
});
|
||||
|
||||
// Start the Express.js server for the XP API
|
||||
app.get('/xp/:guildId/:userId', (req, res) => {
|
||||
const { guildId, userId } = req.params;
|
||||
const xp = db.get(`xp.${guildId}.${userId}`) || 0;
|
||||
res.json({ guildId, userId, xp });
|
||||
app.get('/xp/:guildId/:userId', async (req, res) => {
|
||||
const { guildId, userId } = await req.params;
|
||||
const xp = await db.get(`xp.${guildId}.${userId}`) || 0;
|
||||
await res.json({ guildId, userId, xp });
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
|
|
Loading…
Reference in a new issue