Skip to content

Commit

Permalink
fix: linting issues in features/deduction.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zjorge96 committed Oct 20, 2023
1 parent 3acb26a commit 3603770
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions features/deduction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function respondToDeduction({ message, client }) {
messageText.length < 4 ||
!userRegex.test(messageText[2]) ||
isNaN(+messageText[3])
) {
) {
await client.chat.postEphemeral({
channel: message.channel,
user: message.user,
Expand All @@ -63,7 +63,7 @@ async function respondToDeduction({ message, client }) {
const user = messageText[2].match(userRegex)[1];
const value = +messageText[3];

if (!await deduction.isBalanceSufficent(user, value)) {
if (!(await deduction.isBalanceSufficent(user, value))) {
await client.chat.postEphemeral({
channel: message.channel,
user: message.user,
Expand All @@ -82,6 +82,6 @@ async function respondToDeduction({ message, client }) {
await client.chat.postMessage({
channel: message.channel,
user: message.user,
text: `A deduction of ${value} fistbumps has been made for <@${user}>. Deduction ID is \`${deductionInfo._id}\``
text: `A deduction of ${value} fistbumps has been made for <@${user}>. Deduction ID is \`${deductionInfo._id}\``,
});
}
3 changes: 1 addition & 2 deletions regex.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
var regex = {};
var _ = require("lodash");

regex.userRegex = /<@([^>]+)>/;
regex.deductRegex = /<@([^|>]+)\|/; // For Slash command
regex.groupRegex = /<!subteam\^([a-zA-Z0-9]+)\|@([a-zA-Z0-9]+)>/g;
regex.tagRegex = /#(\S+)/g;
regex.generalEmojiRegex = /:([a-z-_']+):/g;

module.exports = regex;
module.exports = regex;

0 comments on commit 3603770

Please sign in to comment.