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 4adaf6b commit 3acb26a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions features/deduction.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ module.exports = function (app) {
"deduct",
anyOf(directMention(), directMessage()),
respondToDeduction
)
}
);
};

async function respondToDeduction({ message, client }) {
winston.info("@gratibot deduction Called", {
func: "feature.deduction.respondToDeduction",
callingUser: message.user,
slackMessage: message.text,
})
});

const userInfo = await client.users.info({ user: message.user });
if (!userInfo.ok) {
Expand Down Expand Up @@ -47,7 +47,11 @@ async function respondToDeduction({ message, client }) {

const messageText = message.text.split(" ");

if (messageText.length < 4 || !userRegex.test(messageText[2]) || isNaN(+messageText[3])) {
if (
messageText.length < 4 ||
!userRegex.test(messageText[2]) ||
isNaN(+messageText[3])
) {

Check failure on line 54 in features/deduction.js

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
await client.chat.postEphemeral({
channel: message.channel,
user: message.user,
Expand All @@ -56,10 +60,10 @@ async function respondToDeduction({ message, client }) {
return;
}

user = messageText[2].match(userRegex)[1];
value = +messageText[3];
const user = messageText[2].match(userRegex)[1];
const value = +messageText[3];

if (!await deduction.isBalanceSufficent(message.user, value)) {
if (!await deduction.isBalanceSufficent(user, value)) {

Check failure on line 66 in features/deduction.js

View workflow job for this annotation

GitHub Actions / lint

Replace `await·deduction.isBalanceSufficent(user,·value` with `(await·deduction.isBalanceSufficent(user,·value)`
await client.chat.postEphemeral({
channel: message.channel,
user: message.user,
Expand Down

0 comments on commit 3acb26a

Please sign in to comment.