diff --git a/app.js b/app.js index 97c9591..ffd31e0 100644 --- a/app.js +++ b/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); } } } diff --git a/commands.js b/commands.js index ae2ca62..ed938c8 100644 --- a/commands.js +++ b/commands.js @@ -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); } } diff --git a/examples/command.js b/examples/command.js index 7e5b4c0..b3166ef 100644 --- a/examples/command.js +++ b/examples/command.js @@ -58,7 +58,7 @@ function createCommand() { }); console.log(res.body); } catch (err) { - console.error(`Error installing command: ${err}`) + console.error('Error installing commands: ', err); } }