mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-03-18 21:40:27 +01:00
edits from review
This commit is contained in:
8
app.js
8
app.js
@@ -117,9 +117,8 @@ app.post('/interactions', async function (req, res) {
|
||||
});
|
||||
|
||||
await client({ url, method: 'delete' });
|
||||
return;
|
||||
} catch (err) {
|
||||
console.error(`Error sending message: ${err}`);
|
||||
console.error('Error sending message:', err);
|
||||
}
|
||||
} else if (componentId.startsWith('select_choice_')) {
|
||||
// get the associated game ID
|
||||
@@ -145,12 +144,11 @@ app.post('/interactions', async function (req, res) {
|
||||
});
|
||||
|
||||
await client({ url, method: 'patch', data: {
|
||||
"content": `Nice choice ${getRandomEmoji()}`,
|
||||
"content": "Nice choice " + getRandomEmoji(),
|
||||
"components": []
|
||||
}});
|
||||
return;
|
||||
} catch (err) {
|
||||
console.error(`Error sending message: ${err}`);
|
||||
console.error('Error sending message:', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ async function HasGuildCommand(client, appId, guildId, command) {
|
||||
console.log(`"${command["name"]}" command already installed`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Error installing commands: ${e}`)
|
||||
} catch (err) {
|
||||
console.error('Error installing commands: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ export async function InstallGuildCommand(client, appId, guildId, command) {
|
||||
// install command
|
||||
try {
|
||||
await client({ url, method: 'post', data: command});
|
||||
} catch (e) {
|
||||
console.error(`Error installing guild command: ${e}`);
|
||||
} catch (err) {
|
||||
console.error('Error installing commands: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ function createCommand() {
|
||||
});
|
||||
console.log(res.body);
|
||||
} catch (err) {
|
||||
console.error(`Error installing command: ${err}`)
|
||||
console.error('Error installing commands: ', err);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user