Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherBThai committed Oct 23, 2023
1 parent a1b0554 commit de1eabc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 34 deletions.
28 changes: 14 additions & 14 deletions src/commands/commandList/economy/give.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function sendMoney(user, amount, message) {
from: this.msg.author,
to: user,
amount: this.global.toFancyNum(amount),
...canGive
...canGive,
});
if (text) {
if (text.embed) {
Expand All @@ -130,7 +130,7 @@ async function sendMoney(user, amount, message) {
from: this.msg.author,
to: user,
amount: this.global.toFancyNum(amount),
none: true
none: true,
});
if (text) {
if (text.embed) {
Expand Down Expand Up @@ -293,18 +293,18 @@ async function confirmation(user, amount) {
async function checkLimit(user, amount) {
const canGive = await cowoncyUtils.canGive.bind(this)(this.msg.author, user, amount, this);
if (canGive.error) {
const text = await alterGive.alter(this, this.msg.author.id, null, {
from: this.msg.author,
to: user,
amount: this.global.toFancyNum(amount),
...canGive
});
if (text) {
this.send(text);
} else {
this.errorMsg(canGive.error);
}
return false;
const text = await alterGive.alter(this, this.msg.author.id, null, {
from: this.msg.author,
to: user,
amount: this.global.toFancyNum(amount),
...canGive,
});
if (text) {
this.send(text);
} else {
this.errorMsg(canGive.error);
}
return false;
}
return true;
}
2 changes: 1 addition & 1 deletion src/commands/commandList/economy/utils/cowoncyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function checkSender(user, amount, con) {
error: `, you can only send **${this.global.toFancyNum(diff)}** more cowoncy today!`,
limit: this.global.toFancyNum(result[0].send),
limit_diff: this.global.toFancyNum(diff),
senderlimit: true
senderlimit: true,
};
} else {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/commandList/patreon/alterCowoncy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ exports.alter = async function (p, id, text, info) {
};

async function checkDb(p, id, text, info) {
const type = "display";
const type = 'display';
const replacers = {
username: p.getName(info.user),
discriminator: info.user.discriminator,
blank: p.config.emoji.blank,
amount: info.money
amount: info.money,
};

return alterUtils.getAlterCommand('altercowoncy', info.user, type, replacers);
Expand Down
36 changes: 21 additions & 15 deletions src/commands/commandList/patreon/alterGive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const blank = '<:blank:427371936482328596>';
exports.alter = async function (p, id, text, info) {
const result = await checkDb(p, info);
if (result) return result;
if (info.senderlimit || info.senderoverlimit || info.receivelimit || info.receiveoverlimit || info.none) {
if (
info.senderlimit ||
info.senderoverlimit ||
info.receivelimit ||
info.receiveoverlimit ||
info.none
) {
return;
}
switch (id) {
Expand Down Expand Up @@ -50,28 +56,28 @@ function checkDb(p, info) {
let type, replacers;
let user = info.from;
if (info.receiver) {
type = "receive";
type = 'receive';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
receiver: p.getName(info.to),
receiver_tag: p.getTag(info.to),
blank: p.config.emoji.blank,
amount: info.amount,
}
};
user = info.to;
} else if (info.none) {
type = "none";
type = 'none';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
receiver: p.getName(info.to),
receiver_tag: p.getTag(info.to),
blank: p.config.emoji.blank,
amount: info.amount,
}
};
} else if (info.senderlimit) {
type = "senderlimit";
type = 'senderlimit';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
Expand All @@ -81,9 +87,9 @@ function checkDb(p, info) {
limit: info.limit,
limit_diff: info.limit_diff,
amount: info.amount,
}
};
} else if (info.senderoverlimit) {
type = "senderoverlimit";
type = 'senderoverlimit';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
Expand All @@ -92,9 +98,9 @@ function checkDb(p, info) {
blank: p.config.emoji.blank,
limit: info.limit,
amount: info.amount,
}
};
} else if (info.receivelimit) {
type = "receivelimit";
type = 'receivelimit';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
Expand All @@ -104,9 +110,9 @@ function checkDb(p, info) {
limit: info.limit,
limit_diff: info.limit_diff,
amount: info.amount,
}
};
} else if (info.receiveoverlimit) {
type = "receiveoverlimit";
type = 'receiveoverlimit';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
Expand All @@ -115,17 +121,17 @@ function checkDb(p, info) {
blank: p.config.emoji.blank,
limit: info.limit,
amount: info.amount,
}
};
} else {
type = "give";
type = 'give';
replacers = {
sender: p.getName(info.from),
sender_tag: p.getTag(info.from),
receiver: p.getName(info.to),
receiver_tag: p.getTag(info.to),
blank: p.config.emoji.blank,
amount: info.amount,
}
};
}

return alterUtils.getAlterCommand('altergive', user, type, replacers);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/alterUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const mysql = require('../botHandlers/mysqlHandler.js');
const global = require('./global.js');

exports.getAlterCommand = async function(dbName, user, type, replacers, appendText) {
exports.getAlterCommand = async function (dbName, user, type, replacers, appendText) {
const sql = `SELECT ${dbName}.* from ${dbName} INNER JOIN user ON ${dbName}.uid = user.uid WHERE user.id = ${user.id} AND ${dbName}.type = '${type}'`;
console.log(sql);
const result = (await mysql.query(sql))[0];
Expand Down Expand Up @@ -44,4 +44,4 @@ exports.getAlterCommand = async function(dbName, user, type, replacers, appendTe
}

return content;
}
};

0 comments on commit de1eabc

Please sign in to comment.