Skip to content

Commit

Permalink
Merge pull request #159 from CatalysmsServerManager/Adjust-replies-fo…
Browse files Browse the repository at this point in the history
…r-commands-on-error

Do not reply with the error message on command failure
  • Loading branch information
niekcandaele committed Jul 11, 2020
2 parents f0bf975 + 04aa86c commit cce6a38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/hooks/sdtdCommands/commands/callAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class callAdmin extends SdtdCommand {

} catch (error) {
sails.log.error(`HOOK - SdtdCommands:callAdmin - ${error}`);
return chatMessage.reply('error', { error: error });
return chatMessage.reply('error');
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions api/hooks/sdtdCommands/commands/claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Claim extends SdtdCommand {
}, cmdToExec);

if (response.result.includes('ERR:')) {
return chatMessage.reply('error', { error: response.result });
return chatMessage.reply('error');
}

chatMessage.reply('claimItemGiven', {
Expand All @@ -78,7 +78,7 @@ class Claim extends SdtdCommand {
claimed: true
});
} catch (error) {
chatMessage.reply('error', { error: error });
chatMessage.reply('error');
}

});
Expand Down
4 changes: 2 additions & 2 deletions api/hooks/sdtdCommands/customCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class CustomCommand extends SdtdCommand {


} catch (error) {
sails.log.error(`Custom command error - ${server.name} - ${chatMessage.messageText} - ${error}`);
chatMessage.reply(`Error! Contact your server admin with this message: ${error.toString().replace(/\"/g, '')}`);
sails.log.error(`Custom command error - server ${server.id} - ${chatMessage.messageText} - ${error}`);
chatMessage.reply(`Error, please contact your server admin!`);
}
}
}
Expand Down

0 comments on commit cce6a38

Please sign in to comment.