Фикс проблем ESLint

This commit is contained in:
JonnyBro 2022-01-13 00:26:23 +05:00
parent 65261568ca
commit 8a0217010a
159 changed files with 592 additions and 648 deletions

View file

@ -63,7 +63,7 @@ class JaBa extends Client {
this.player
.on("playSong", async (queue, song) => {
const m = await queue.textChannel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: song.name }) })
const m = await queue.textChannel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: song.name }) });
if (!song.isLive) {
setTimeout(() => {
if (m.deletable) m.delete();
@ -77,7 +77,7 @@ class JaBa extends Client {
.on("addSong", (queue, song) => queue.textChannel.send({ content: this.translate("music/play:ADDED_QUEUE", { songName: song.name }) }))
.on("addList", (queue, playlist) => queue.textChannel.send({ content: this.translate("music/play:ADDED_QUEUE_COUNT", { songCount: playlist.songs.length }) }))
.on("searchResult", (message, result) => {
let i = 0
let i = 0;
const embed = new MessageEmbed()
.setDescription(Util.escapeSpoiler(result.map(song => `**${++i} -** ${song.name}`).join("\n")))
.setFooter({ text: this.translate("music/play:RESULTS_FOOTER") })
@ -105,11 +105,11 @@ class JaBa extends Client {
reaction: "🎉"
}
});
};
}
get defaultLanguage() {
return this.languages.find(language => language.default).name;
};
}
translate(key, args, locale) {
if (!locale) locale = this.defaultLanguage;
@ -117,7 +117,7 @@ class JaBa extends Client {
if (!language) throw "Invalid language set in data.";
return language(key, args);
};
}
printDate(date, format, locale) {
if (!locale) locale = this.defaultLanguage;
@ -127,7 +127,7 @@ class JaBa extends Client {
return moment(new Date(date))
.locale(languageData.moment)
.format(format);
};
}
convertTime(time, type, noPrefix, locale) {
if (!type) time = "to";
@ -136,7 +136,7 @@ class JaBa extends Client {
const m = moment(time).locale(languageData.moment);
return (type === "to" ? m.toNow(noPrefix) : m.fromNow(noPrefix));
};
}
getNoun(number, one, two, five) {
let n = Math.abs(number);
@ -147,7 +147,7 @@ class JaBa extends Client {
if (n >= 2 && n <= 4) return two;
return five;
};
}
// This function is used to load a command and add it to the collection
loadCommand(commandPath, commandName) {
@ -165,8 +165,8 @@ class JaBa extends Client {
return false;
} catch (e) {
return `Unable to load command ${commandName}: ${e}`;
};
};
}
}
// This function is used to unload a command (you need to load them again)
async unloadCommand(commandPath, commandName) {
@ -180,7 +180,7 @@ class JaBa extends Client {
delete require.cache[require.resolve(`.${commandPath}${path.sep}${commandName}.js`)];
return false;
};
}
// This function is used to find a user data or create it
async findOrCreateUser({ id: userID }, isLean) {
@ -203,9 +203,9 @@ class JaBa extends Client {
this.databaseCache.users.set(userID, userData);
return isLean ? userData.toJSON() : userData;
};
};
};
}
}
}
// This function is used to find a member data or create it
async findOrCreateMember({ id: memberID, guildID }, isLean) {
@ -234,13 +234,13 @@ class JaBa extends Client {
if (guild) {
guild.members.push(memberData._id);
await guild.save();
};
}
this.databaseCache.members.set(`${memberID}${guildID}`, memberData);
return isLean ? memberData.toJSON() : memberData;
};
};
};
}
}
}
// This function is used to find a guild data or create it
async findOrCreateGuild({ id: guildID }, isLean) {
@ -263,9 +263,9 @@ class JaBa extends Client {
this.databaseCache.guilds.set(guildID, guildData);
return isLean ? guildData.toJSON() : guildData;
};
};
};
}
}
}
// This function is used to resolve a user from a string
async resolveUser(search) {
@ -277,7 +277,7 @@ class JaBa extends Client {
const id = search.match(/^<@!?(\d+)>$/)[1];
user = this.users.fetch(id).catch(() => {});
if (user) return user;
};
}
// Try username search
if (search.match(/^!?(\w+)#(\d+)$/)) {
@ -285,11 +285,11 @@ class JaBa extends Client {
const discriminator = search.match(/^!?(\w+)#(\d+)$/)[1];
user = this.users.find((u) => u.username === username && u.discriminator === discriminator);
if (user) return user;
};
}
user = await this.users.fetch(search).catch(() => {});
return user;
};
}
async resolveMember(search, guild) {
let member = null;
@ -300,18 +300,18 @@ class JaBa extends Client {
const id = search.match(/^<@!?(\d+)>$/)[1];
member = await guild.members.fetch(id).catch(() => {});
if (member) return member;
};
}
// Try username search
if (search.match(/^!?(\w+)#(\d+)$/)) {
guild = await guild.fetch();
member = guild.members.cache.find((m) => m.user.tag === search);
if (member) return member;
};
}
member = await guild.members.fetch(search).catch(() => {});
return member;
};
}
async resolveRole(search, guild) {
let role = null;
@ -322,7 +322,7 @@ class JaBa extends Client {
const id = search.match(/^<@&!?(\d+)>$/)[1];
role = guild.roles.cache.get(id);
if (role) return role;
};
}
// Try name search
role = guild.roles.cache.find((r) => search === r.name);
@ -330,7 +330,7 @@ class JaBa extends Client {
role = guild.roles.cache.get(search);
return role;
};
};
}
}
module.exports = JaBa;

View file

@ -6,7 +6,7 @@ const genToken = () => {
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzy0123456789.-_";
for (let i = 0; i < 32; i++) {
token += characters.charAt(Math.floor(Math.random() * characters.length));
};
}
return token;
};
@ -112,7 +112,7 @@ userSchema.method("getAchievements", async function() {
for (let i = 0; i < images.length; i++) {
await ctx.drawImage(images[i], dim, 10, 350, 200);
dim += 200;
};
}
return canvas.toBuffer();
});

View file

@ -37,6 +37,6 @@ class Addcommand extends Command {
prefix: data.guild.prefix
});
}
};
}
module.exports = Addcommand;

View file

@ -33,6 +33,6 @@ class Addemoji extends Command {
emojiName: name
}));
}
};
}
module.exports = Addemoji;

View file

@ -47,9 +47,9 @@ class Automod extends Command {
data.guild.markModified("plugins.automod");
data.guild.save();
message.success("administration/automod:DISABLED");
};
};
}
}
}
};
}
module.exports = Automod;

View file

@ -53,8 +53,8 @@ class Autorole extends Command {
message.success("administration/autorole:SUCCESS_DISABLED", {
prefix: data.guild.prefix
});
};
}
}
};
}
module.exports = Autorole;

View file

@ -121,8 +121,8 @@ class Backup extends Command {
});
} else {
return message.error("administration/backup:MISSING_STATUS");
};
}
}
};
}
module.exports = Backup;

View file

@ -91,6 +91,6 @@ class Configuration extends Command {
embeds: [embed]
});
}
};
}
module.exports = Configuration;

View file

@ -28,6 +28,6 @@ class Delcommand extends Command {
commandName: name
});
}
};
}
module.exports = Delcommand;

View file

@ -28,8 +28,8 @@ class Deletemod extends Command {
data.guild.autoDeleteModCommands = false;
data.guild.save();
message.success("administration/deletemod:DISABLED");
};
}
}
};
}
module.exports = Deletemod;

View file

@ -21,7 +21,7 @@ class Goodbye extends Command {
if (args[0] === "test" && data.guild.plugins.goodbye.enabled) {
this.client.emit("guildMemberRemove", message.member);
return message.success("administration/goodbye:TEST_SUCCESS");
};
}
if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.goodbye.enabled) return message.error("administration/goodbye:MISSING_STATUS");
@ -58,13 +58,10 @@ class Goodbye extends Command {
collector.on("collect", async msg => {
// If the message is filled, it means the user sent yes or no for the image
if (goodbye.message) {
if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
goodbye.withImage = true;
} else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) {
goodbye.withImage = false;
} else {
return message.error("misc:INVALID_YES_NO");
};
if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) goodbye.withImage = true;
else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) goodbye.withImage = false;
else return message.error("misc:INVALID_YES_NO");
data.guild.plugins.goodbye = goodbye;
data.guild.markModified("plugins.goodbye");
await data.guild.save();
@ -73,16 +70,16 @@ class Goodbye extends Command {
channel: `<#${goodbye.channel}>`
});
return collector.stop();
};
}
// If the channel is filled and the message is not, it means the user sent the message
if (goodbye.channel && !goodbye.message) {
if (msg.content.length < 1800) {
goodbye.message = msg.content;
return message.sendT("administration/goodbye:FORM_3");
};
}
return message.error("administration/goodbye:MAX_CHARACT");
};
}
// If the channel is not filled, it means the user sent it
if (!goodbye.channel) {
@ -98,14 +95,14 @@ class Goodbye extends Command {
author: msg.author.tag,
memberCount: msg.guild.memberCount
});
};
}
});
collector.on("end", (_, reason) => {
if (reason === "time") return message.error("misc:TIMES_UP");
});
};
}
}
};
}
module.exports = Goodbye;

View file

@ -34,8 +34,8 @@ class Ignore extends Command {
return message.success("administration/ignore:IGNORED", {
channel: channel.toString()
});
};
}
}
};
}
module.exports = Ignore;

View file

@ -16,7 +16,7 @@ class Set extends Command {
});
}
async run(message, args, data) {
async run(message, args) {
const status = args[0];
if (!status || !["level", "xp", "credits", "bank"].includes(status)) return message.error("administration/set:NO_STATUS");
@ -52,6 +52,6 @@ class Set extends Command {
amount
});
}
};
}
module.exports = Set;

View file

@ -38,8 +38,8 @@ class Setbirthdays extends Command {
return message.success("administration/setbirthdays:ENABLED", {
channel: channel.toString()
});
};
}
}
};
}
module.exports = Setbirthdays;

View file

@ -28,6 +28,6 @@ class Setlang extends Command {
lang: language.nativeName
});
}
};
}
module.exports = Setlang;

View file

@ -38,8 +38,8 @@ class Setmodlogs extends Command {
return message.success("administration/setmodlogs:ENABLED", {
channel: channel.toString()
});
};
}
}
};
}
module.exports = Setmodlogs;

View file

@ -28,6 +28,6 @@ class Setprefix extends Command {
prefix
});
}
};
}
module.exports = Setprefix;

View file

@ -38,8 +38,8 @@ class Setreports extends Command {
return message.success("administration/setreports:ENABLED", {
channel: channel.toString()
});
};
}
}
};
}
module.exports = Setreports;

View file

@ -38,8 +38,8 @@ class Setsuggests extends Command {
return message.success("administration/setsuggests:ENABLED", {
channel: channel.toString()
});
};
}
}
};
}
module.exports = Setsuggests;

View file

@ -47,8 +47,8 @@ class Slowmode extends Command {
channel: `#${channel.name}`,
time: this.client.functions.convertTime(message.guild, ms(time))
});
};
}
}
};
}
module.exports = Slowmode;

View file

@ -21,7 +21,7 @@ class Welcome extends Command {
if (args[0] === "test" && data.guild.plugins.welcome.enabled) {
this.client.emit("guildMemberAdd", message.member);
return message.success("administration/welcome:TEST_SUCCESS");
};
}
if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.welcome.enabled) return message.error("administration/welcome:MISSING_STATUS");
@ -64,7 +64,7 @@ class Welcome extends Command {
welcome.withImage = false;
} else {
return message.error("misc:INVALID_YES_NO");
};
}
data.guild.plugins.welcome = welcome;
data.guild.markModified("plugins.welcome");
await data.guild.save();
@ -73,16 +73,16 @@ class Welcome extends Command {
channel: `<#${welcome.channel}>`
});
return collector.stop();
};
}
// If the channel is filled and the message is not, it means the user sent the message
if (welcome.channel && !welcome.message) {
if (msg.content.length < 1800) {
welcome.message = msg.content;
return message.sendT("administration/welcome:FORM_3");
};
}
return message.error("administration/goodbye:MAX_CHARACT");
};
}
// If the channel is not filled, it means the user sent it
if (!welcome.channel) {
@ -98,16 +98,14 @@ class Welcome extends Command {
author: msg.author.tag,
memberCount: msg.guild.memberCount
});
};
}
});
collector.on("end", (_, reason) => {
if (reason === "time") {
return message.error("misc:TIMES_UP");
};
if (reason === "time") return message.error("misc:TIMES_UP");
});
};
}
}
};
}
module.exports = Welcome;

View file

@ -75,6 +75,6 @@ class Achievements extends Command {
embeds: [embed]
});
}
};
}
module.exports = Achievements;

View file

@ -45,6 +45,6 @@ class Birthdate extends Command {
date: message.printDate(d)
});
}
};
}
module.exports = Birthdate;

View file

@ -26,7 +26,7 @@ class Deposit extends Command {
} else {
if (isNaN(amount) || parseInt(amount, 10) < 1) return message.error("economy/deposit:MISSING_AMOUNT");
amount = parseInt(amount, 10);
};
}
if (data.memberData.money < amount) return message.error("economy/deposit:NOT_ENOUGH_CREDIT", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
@ -47,6 +47,6 @@ class Deposit extends Command {
money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
});
}
};
}
module.exports = Deposit;

View file

@ -39,6 +39,6 @@ class Divorce extends Command {
})
});
}
};
}
module.exports = Divorce;

View file

@ -83,11 +83,11 @@ class Leaderboard extends Command {
message.channel.send({
content: "```\n" + newTable.toString() + "```"
});
};
}
if (isOnlyOnMobile) message.sendT("economy/leaderboard:MOBILE");
}
};
}
module.exports = Leaderboard;
@ -105,4 +105,4 @@ async function fetchUsers(array, table, client) {
});
resolve(table);
});
};
}

View file

@ -58,8 +58,8 @@ class Marry extends Command {
firstUsername: member.user.tag,
secondUsername: user.tag
});
};
};
}
}
// Update pending requests
pendings[message.author.id] = member.id;
@ -82,17 +82,13 @@ class Marry extends Command {
return collector.stop(false);
} else {
return message.error("misc:INVALID_YES_NO");
};
}
});
collector.on("end", async (_collected, reason) => {
// Delete pending request
delete pendings[message.author.id];
if (reason === "time") {
return message.error("economy/marry:TIMEOUT", {
username: member.user.toString()
});
};
if (reason === "time") return message.error("economy/marry:TIMEOUT", { username: member.user.toString() });
if (reason) {
data.userData.lover = member.id;
await data.userData.save();
@ -113,14 +109,14 @@ class Marry extends Command {
userData.achievements.married.progress.now = 1;
userData.markModified("achievements.married");
userData.save();
};
}
if (!data.userData.achievements.married.achieved) {
if (!sent) message.channel.send(messageOptions);
data.userData.achievements.married.achieved = true;
data.userData.achievements.married.progress.now = 1;
data.userData.markModified("achievements.married");
data.userData.save();
};
}
return message.success("economy/marry:SUCCESS", {
creator: message.author.toString(),
partner: member.user.toString()
@ -130,9 +126,9 @@ class Marry extends Command {
creator: message.author.toString(),
partner: member.user.toString()
});
};
}
});
}
};
}
module.exports = Marry;

View file

@ -70,6 +70,6 @@ class Money extends Command {
embeds: [embed]
});
}
};
}
module.exports = Money;

View file

@ -54,6 +54,6 @@ class Pay extends Command {
username: member.user.tag
});
}
};
}
module.exports = Pay;

View file

@ -26,7 +26,7 @@ class Profile extends Command {
}
async run(message, args, data) {
const arg = args[0] || message.author
const arg = args[0] || message.author;
let member = await this.client.resolveMember(arg, message.guild);
if (!member) member = message.member;
if (member.user.bot) return message.error("economy/profile:BOT_USER");
@ -92,6 +92,6 @@ class Profile extends Command {
}]
}); // Send the embed in the current channel
}
};
}
module.exports = Profile;

View file

@ -28,7 +28,7 @@ class Rep extends Command {
if (isInCooldown > Date.now()) return message.error("economy/rep:COOLDOWN", {
time: message.convertTime(isInCooldown, "to", true)
});
};
}
const user = await this.client.resolveUser(args[0]);
if (!user) return message.error("economy/rep:INVALID_USER");
@ -56,15 +56,15 @@ class Rep extends Command {
attachment: "./assets/img/achievements/achievement_unlocked6.png"
}]
});
};
}
userData.markModified("achievements.rep");
};
}
await userData.save();
message.success("economy/rep:SUCCESS", {
username: user.username
});
}
};
}
module.exports = Rep;

View file

@ -28,7 +28,7 @@ class Rob extends Command {
const isInCooldown = memberData.cooldowns.rob || 0;
if (isInCooldown) {
if (isInCooldown > Date.now()) return message.error("economy/rob:COOLDOWN", { username: member.user.tag });
};
}
let amountToRob = args[1];
if (!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0) return message.error("economy/rob:MISSING_AMOUNT", { username: member.user.username });
@ -71,8 +71,8 @@ class Rob extends Command {
memberData.money += won;
memberData.save();
data.memberData.save();
};
}
}
};
}
module.exports = Rob;

View file

@ -25,6 +25,6 @@ class Setbio extends Command {
message.success("economy/setbio:SUCCESS");
await data.userData.save();
}
};
}
module.exports = Setbio;

View file

@ -42,7 +42,7 @@ class Slots extends Command {
else if (isJackpot) number = number * 4;
return Math.round(number);
};
}
const tmsg = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading"
@ -105,13 +105,13 @@ class Slots extends Command {
attachment: "./assets/img/achievements/achievement_unlocked4.png"
}]
});
};
}
data.userData.markModified("achievements.slots");
await data.userData.save();
};
}
await data.memberData.save();
return;
};
}
if (colonnes[0][i2] == colonnes[1][j2] || colonnes[1][j2] == colonnes[2][k2] || colonnes[0][i2] == colonnes[2][k2]) {
msg += "| : : : **" + (message.translate("common:VICTORY").toUpperCase()) + "** : : : |";
@ -146,13 +146,13 @@ class Slots extends Command {
attachment: "./assets/img/achievements/achievement_unlocked4.png"
}]
});
};
}
data.userData.markModified("achievements.slots");
await data.userData.save();
};
}
await data.memberData.save();
return;
};
}
msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |";
message.channel.send({
@ -176,10 +176,10 @@ class Slots extends Command {
data.userData.achievements.slots.progress.now = 0;
data.userData.markModified("achievements.slots");
await data.userData.save();
};
}
await data.memberData.save();
return;
};
}
function editMsg() {
let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n";
@ -199,8 +199,8 @@ class Slots extends Command {
msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n";
tmsg.edit(msg);
};
}
}
};
}
module.exports = Slots;

View file

@ -24,8 +24,8 @@ class Transactions extends Command {
if (t.date > timestamp) {
const index = transactions.indexOf(t);
transactions.splice(index, 1);
};
};
}
}
const embed = new Discord.MessageEmbed()
.setAuthor({
@ -54,13 +54,13 @@ class Transactions extends Command {
embeds: [embed]
});
} else {
embed.addField(message.translate("economy/transactions:T_GOT"), sortedTransactions[0].join("\n"), true)
embed.addField(message.translate("economy/transactions:T_SEND"), sortedTransactions[1].join("\n"), true)
};
embed.addField(message.translate("economy/transactions:T_GOT"), sortedTransactions[0].join("\n"), true);
embed.addField(message.translate("economy/transactions:T_SEND"), sortedTransactions[1].join("\n"), true);
}
message.channel.send({
embeds: [embed]
});
}
};
}
module.exports = Transactions;

View file

@ -26,7 +26,7 @@ class Withdraw extends Command {
} else {
if (isNaN(amount) || parseInt(amount, 10) < 1) return message.error("economy/withdraw:MISSING_AMOUNT");
amount = parseInt(amount, 10);
};
}
if (data.memberData.bankSold < amount) return message.error("economy/withdraw:NOT_ENOUGH", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
@ -47,6 +47,6 @@ class Withdraw extends Command {
money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
});
}
};
}
module.exports = Withdraw;

View file

@ -27,7 +27,7 @@ class Work extends Command {
if (isInCooldown > Date.now()) return message.error("economy/work:COOLDOWN", {
time: message.convertTime(isInCooldown, "to", true)
});
};
}
if (Date.now() > data.memberData.cooldowns.work + (24 * 3600000)) data.memberData.workStreak = 0;
@ -62,8 +62,8 @@ class Work extends Command {
if (data.memberData.workStreak >= 5) {
won += 200;
embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", {
won: `${won} ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
}))
won: `${won} ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
}))
.addField(message.translate("economy/work:STREAK"), message.translate("economy/work:STREAK_CONTENT"));
data.memberData.workStreak = 0;
} else {
@ -71,13 +71,13 @@ class Work extends Command {
if (data.memberData.workStreak > i) {
const letter = Discord.Util.parseEmoji(award[i]).name.split("_")[1];
award[i] = `:regional_indicator_${letter.toLowerCase()}:`;
};
};
}
}
embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", {
won: `**${won}** ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
}))
won: `**${won}** ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
}))
.addField(message.translate("economy/work:STREAK"), award.join(""));
};
}
const info = {
user: message.translate("economy/work:SALARY"),
@ -101,14 +101,14 @@ class Work extends Command {
attachment: "./assets/img/achievements/achievement_unlocked1.png"
}];
data.userData.achievements.work.achieved = true;
};
}
data.userData.markModified("achievements.work");
data.userData.save();
};
}
// Send the embed in the current channel
message.channel.send(messageOptions);
}
};
}
module.exports = Work;

View file

@ -26,6 +26,6 @@ class Eightball extends Command {
content: answer
});
}
};
}
module.exports = Eightball;

View file

@ -29,6 +29,6 @@ class Ascii extends Command {
content: "```" + rendered + "```"
});
}
};
}
module.exports = Ascii;

View file

@ -31,6 +31,6 @@ class Choice extends Command {
});
}, 1500);
}
};
}
module.exports = Choice;

View file

@ -41,7 +41,7 @@ class FindWords extends Command {
for (let i = 0; i < nbGames; i++) {
const result = Math.floor((Math.random() * wordList.length));
words.push(wordList[result].substring(0, 3).toLowerCase());
};
}
let i = 0; // Inits i variable to count games
currentGames[message.guild.id] = true; // Update current game variable
@ -77,18 +77,14 @@ class FindWords extends Command {
});
collector.on("end", async (collected, reason) => {
if (reason === "time") {
message.error("fun/findwords:NO_WINNER");
} else if (reason === "force") {
return message.error("misc:FORCE_STOP", {
user: message.author.toString()
});
} else {
if (reason === "time") message.error("fun/findwords:NO_WINNER");
else if (reason === "force") return message.error("misc:FORCE_STOP", { user: message.author.toString() });
else {
message.success("fun/findwords:WORD_FOUND", {
winner: `<@${reason}>`
});
winners.push(reason);
};
}
if (i < nbGames - 1) {
i++;
@ -130,11 +126,11 @@ class FindWords extends Command {
userdata.money = userdata.money + won;
userdata.save();
};
};
}
}
});
}, delay);
};
}
async function getWinner(array) {
return new Promise(function (resolve) {
@ -150,12 +146,12 @@ class FindWords extends Command {
if (counts[winner] > compare) {
compare = counts[winner];
mostFrequent = array[i];
};
};
}
}
resolve(mostFrequent);
});
};
}
}
};
}
module.exports = FindWords;

View file

@ -20,6 +20,6 @@ class Flip extends Command {
const isHeads = Math.random() > 0.5;
isHeads ? message.sendT("fun/flip:HEADS") : message.sendT("fun/flip:TAILS");
}
};
}
module.exports = Flip;

View file

@ -34,6 +34,6 @@ class Fml extends Command {
embeds: [embed]
});
}
};
}
module.exports = Fml;

View file

@ -34,6 +34,6 @@ class Joke extends Command {
embeds: [embed]
});
}
};
}
module.exports = Joke;

View file

@ -25,6 +25,6 @@ class Lmg extends Command {
});
message.delete().catch(() => {});
}
};
}
module.exports = Lmg;

View file

@ -54,6 +54,6 @@ class Lovecalc extends Command {
embeds: [embed]
});
}
};
}
module.exports = Lovecalc;

View file

@ -79,27 +79,20 @@ class Number extends Command {
userdata.money = userdata.money + won;
userdata.save();
};
}
collector.stop();
};
}
if (parseInt(msg.content) < number) message.error("fun/number:BIG", { user: msg.author.toString(), number: parsedNumber });
if (parseInt(msg.content) > number) message.error("fun/number:SMALL", { user: msg.author.toString(), number: parsedNumber });
});
collector.on("end", (_collected, reason) => {
delete currentGames[message.guild.id];
if (reason === "time") {
return message.error("fun/number:DEFEAT", {
number
});
} else if (reason === "force") {
return message.error("misc:FORCE_STOP", {
user: message.author.toString()
});
};
if (reason === "time") return message.error("fun/number:DEFEAT", { number });
else if (reason === "force") return message.error("misc:FORCE_STOP", { user: message.author.toString() });
});
}
};
}
module.exports = Number;

View file

@ -17,8 +17,8 @@ class TicTacToe extends Command {
});
}
async run(message, args) {
const game = new TTT({ language: "ru" })
async run(message) {
const game = new TTT({ language: "ru" });
game.handleMessage(message);
game.on("win", async (data) => {
@ -46,6 +46,6 @@ class TicTacToe extends Command {
userdata.save();
});
}
};
}
module.exports = TicTacToe;

View file

@ -37,7 +37,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -53,7 +53,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -69,7 +69,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -85,7 +85,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -101,7 +101,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -117,7 +117,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -133,7 +133,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -149,7 +149,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -165,7 +165,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -181,7 +181,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -197,7 +197,7 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
@ -213,14 +213,14 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
return message.channel.send({
embeds: [embed]
});
});
break;
default:
default: {
const embed = new Discord.MessageEmbed()
.setTitle(message.translate("general/activity:TITLE"))
.setDescription(activities.join("\n"))
@ -228,13 +228,13 @@ class Activity extends Command {
.setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp()
.setTimestamp();
message.channel.send({
embeds: [embed]
});
break;
};
}
}
}
};
}
module.exports = Activity;

View file

@ -47,6 +47,6 @@ class Github extends Command {
embeds: [embed]
});
}
};
}
module.exports = Github;

View file

@ -47,8 +47,8 @@ class Hastebin extends Command {
});
} catch (e) {
message.error("misc:ERR_OCCURRED");
};
}
}
};
}
module.exports = Hastebin;

View file

@ -30,7 +30,7 @@ class Help extends Command {
return message.error("general/help:NOT_FOUND", {
search: args[0]
});
};
}
const description = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`);
const usage = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, {
@ -59,7 +59,7 @@ class Help extends Command {
return message.channel.send({
embeds: [groupEmbed]
});
};
}
const categories = [];
const commands = this.client.commands;
@ -68,7 +68,7 @@ class Help extends Command {
if (!categories.includes(command.help.category)) {
if (command.help.category === "Owner" && message.author.id !== this.client.config.owner.id) return;
categories.push(command.help.category);
};
}
});
const emojis = this.client.customEmojis;
@ -88,7 +88,7 @@ class Help extends Command {
if (message.guild) {
if (data.guild.customCommands.length > 0) embed.addField(`${emojis.categories.custom} ${message.guild.name} | ${message.translate("general/help:CUSTOM_COMMANDS")} - (${data.guild.customCommands.length})`, data.guild.customCommands.map((cmd) => `\`${cmd.name}\``).join(", "));
};
}
embed.addField("\u200B", message.translate("misc:STATS_FOOTER", {
dashboardLink: "https://jaba.pp.ua/",
@ -111,6 +111,6 @@ class Help extends Command {
embeds: [embed]
});
}
};
}
module.exports = Help;

View file

@ -33,8 +33,8 @@ class Invitations extends Command {
return message.error("general/invitations:NOBODY_MEMBER", {
member: member.user.tag
});
};
};
}
}
const content = memberInvites.map((i) => {
return message.translate("general/invitations:CODE", {
@ -67,6 +67,6 @@ class Invitations extends Command {
embeds: [embed]
});
}
};
}
module.exports = Invitations;

View file

@ -48,6 +48,6 @@ class Invite extends Command {
embeds: [embed]
});
}
};
}
module.exports = Invite;

View file

@ -37,7 +37,7 @@ class Minecraft extends Command {
host: ip[0],
port: ip[1]
};
};
}
const m = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading"
@ -58,7 +58,7 @@ class Minecraft extends Command {
}).catch((err) => {
Sentry.captureException(err);
});
};
}
if (!json) return m.error("general/minecraft:FAILED", null, { edit: true });
@ -92,6 +92,6 @@ class Minecraft extends Command {
files: [imgAttachment]
});
}
};
}
module.exports = Minecraft;

View file

@ -34,13 +34,13 @@ class Permissions extends Command {
} else {
text += `${perm}\n`;
total.allowed++;
};
}
});
text += `\n${total.allowed} ✅ | ${total.denied}` + "\n```";
message.channel.send({
content: text
});
}
};
}
module.exports = Permissions;

View file

@ -25,6 +25,6 @@ class Ping extends Command {
}, { edit: true });
});
}
};
}
module.exports = Ping;

View file

@ -36,7 +36,7 @@ class Quote extends Command {
.setTimestamp(m.createdTimestamp);
if (m.attachments.size > 0) embed.setImage(m.attachments.first().url);
return embed;
};
}
const msgID = args[0];
if (isNaN(msgID)) {
@ -48,7 +48,7 @@ class Quote extends Command {
message.error("misc:CANNOT_DM");
});
return;
};
}
let channel = args[1];
if (args[1]) {
@ -57,18 +57,18 @@ class Quote extends Command {
message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => {
message.delete();
}).catch(() => {
message.error("misc:CANNOT_DM")
message.error("misc:CANNOT_DM");
});
return;
};
};
}
}
if (!channel) {
message.channel.messages.fetch(msgID).catch(() => {
message.author.send((message.translate("general/quote:NO_MESSAGE_ID"))).then(() => {
message.delete();
}).catch(() => {
message.error("misc:CANNOT_DM")
message.error("misc:CANNOT_DM");
});
return;
}).then((msg) => {
@ -82,7 +82,7 @@ class Quote extends Command {
message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => {
message.delete();
}).catch(() => {
message.error("misc:CANNOT_DM")
message.error("misc:CANNOT_DM");
});
return;
}).then((msg) => {
@ -91,8 +91,8 @@ class Quote extends Command {
embeds: [embed(msg)]
});
});
};
}
}
};
}
module.exports = Quote;

View file

@ -40,6 +40,6 @@ class Remindme extends Command {
message.success("general/remindme:SAVED");
}
};
}
module.exports = Remindme;

View file

@ -64,6 +64,6 @@ class Report extends Command {
channel: repChannel.toString()
});
}
};
}
module.exports = Report;

View file

@ -25,8 +25,8 @@ class Serverinfo extends Command {
if (!found) {
found = this.client.guilds.cache.find(g => g.name.includes(args.join(" ")) || g.id === args[0]);
if (found) guild = found;
};
};
}
}
await guild.members.fetch();
const owner = await guild.fetchOwner();
@ -65,6 +65,6 @@ class Serverinfo extends Command {
embeds: [embed]
});
}
};
}
module.exports = Serverinfo;

View file

@ -28,7 +28,7 @@ class Setafk extends Command {
return message.sendT("general/setafk:DELETED", {
username: message.author.username
});
};
}
} else {
data.userData.afk = reason;
data.userData.save();
@ -42,8 +42,8 @@ class Setafk extends Command {
if (m.deletable) m.delete();
if (message.deletable) message.delete();
}, 10 * 1000);
};
}
}
};
}
module.exports = Setafk;

View file

@ -37,6 +37,6 @@ class ShortURL extends Command {
embeds: [embed]
});
}
};
}
module.exports = ShortURL;

View file

@ -34,6 +34,6 @@ class Someone extends Command {
embeds: [embed]
});
}
};
}
module.exports = Someone;

View file

@ -37,6 +37,6 @@ class Staff extends Command {
embeds: [embed]
});
}
};
}
module.exports = Staff;

View file

@ -58,6 +58,6 @@ class Stats extends Command {
embeds: [statsEmbed]
});
}
};
}
module.exports = Stats;

View file

@ -59,6 +59,6 @@ class Suggest extends Command {
channel: suggChannel.toString()
});
}
};
}
module.exports = Suggest;

View file

@ -29,7 +29,7 @@ class Translate extends Command {
message.error("misc:CANNOT_DM");
});
return;
};
}
const pWait = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading"
@ -67,6 +67,6 @@ class Translate extends Command {
embeds: [resEmbed]
});
}
};
}
module.exports = Translate;

View file

@ -32,8 +32,8 @@ class Userinfo extends Command {
if (!user) {
user = await this.client.users.fetch(args[0], true).catch(() => {});
displayPresence = false;
};
};
}
}
if (!user) return message.error("general/userinfo:INVALID_USER");
@ -68,23 +68,23 @@ class Userinfo extends Command {
if (displayPresence) {
if (member.presence.activities[0].name === "Custom Status") {
embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `Пользовательский статус\n${member.presence.activities[0].state || message.translate("common:NOT_DEFINED")}` : message.translate("general/userinfo:NO_GAME")), true)
embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `Пользовательский статус\n${member.presence.activities[0].state || message.translate("common:NOT_DEFINED")}` : message.translate("general/userinfo:NO_GAME")), true);
embed.addField(this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (member.presence.status.toUpperCase())), true);
} else {
embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")), true)
embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")), true);
embed.addField(this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (member.presence.status.toUpperCase())), true);
};
};
}
}
if (member) {
// embed.addField(this.client.customEmojis.up + " " + message.translate("general/userinfo:ROLE"), (member.roles.highest ? member.roles.highest : message.translate("general/userinfo:NO_ROLE")), true)
embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true)
embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true)
embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true)
embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true);
embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true);
embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true);
embed.addField(this.client.customEmojis.roles + " " + message.translate("common:ROLES"), (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 9).join(", ") + " " + message.translate("general/userinfo:MORE_ROLES", {
count: member.roles.cache.size - 10
}) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", ")));
};
}
if (user.bot && this.client.config.apiKeys.dbl && (this.client.config.apiKeys.dbl !== "")) {
const res = await fetch("https://discordbots.org/api/bots/" + user.id, {
@ -102,13 +102,13 @@ class Userinfo extends Command {
lib: data.lib || "unknown"
}), true)
.addField(this.client.customEmojis.link + " " + message.translate("common:LINKS"), `${data.support ? `[${message.translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${message.translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${message.translate("common:WEBSITE")}](${data.website})` : ""}`, true);
};
};
}
}
message.channel.send({
embeds: [embed]
});
}
};
}
module.exports = Userinfo;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Approved extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Approved extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Approved extends Command {
}]
});
}
};
}
module.exports = Approved;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Avatar extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Avatar extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -34,6 +33,6 @@ class Avatar extends Command {
}]
});
}
};
}
module.exports = Avatar;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class BatSlap extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class BatSlap extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -43,6 +42,6 @@ class BatSlap extends Command {
}]
});
}
};
}
module.exports = BatSlap;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Beautiful extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Beautiful extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Beautiful extends Command {
}]
});
}
};
}
module.exports = Beautiful;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
canvacord = require("canvacord");
class Bed extends Command {
@ -14,7 +13,7 @@ class Bed extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -45,8 +44,8 @@ class Bed extends Command {
m.error("misc:ERROR_OCCURRED", null, {
edit: true
});
};
}
}
};
}
module.exports = Bed;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Brazzers extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Brazzers extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Brazzers extends Command {
}]
});
}
};
}
module.exports = Brazzers;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Burn extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Burn extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Burn extends Command {
}]
});
}
};
}
module.exports = Burn;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
fetch = require("node-fetch");
class Captcha extends Command {
@ -14,7 +13,7 @@ class Captcha extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -38,8 +37,8 @@ class Captcha extends Command {
m.error("misc:ERR_OCCURRED", null, {
edit: true
});
};
}
}
};
}
module.exports = Captcha;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Challenger extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Challenger extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Challenger extends Command {
}]
});
}
};
}
module.exports = Challenger;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
fetch = require("node-fetch");
class Clyde extends Command {
@ -14,7 +13,7 @@ class Clyde extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -40,8 +39,8 @@ class Clyde extends Command {
m.error("misc:ERROR_OCCURRED", null, {
edit: true
});
};
}
}
};
}
module.exports = Clyde;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Dictator extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Dictator extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Dictator extends Command {
}]
});
}
};
}
module.exports = Dictator;

View file

@ -1,6 +1,5 @@
const Command = require("../../base/Command.js"),
Canvas = require("canvas"),
Discord = require("discord.js");
Canvas = require("canvas");
class Facepalm extends Command {
constructor(client) {
@ -14,7 +13,7 @@ class Facepalm extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -50,6 +49,6 @@ class Facepalm extends Command {
}]
});
}
};
}
module.exports = Facepalm;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Fire extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Fire extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Fire extends Command {
}]
});
}
};
}
module.exports = Fire;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Jail extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Jail extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Jail extends Command {
}]
});
}
};
}
module.exports = Jail;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
fetch = require("node-fetch");
class Love extends Command {
@ -14,7 +13,7 @@ class Love extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -41,8 +40,8 @@ class Love extends Command {
m.error("misc:ERROR_OCCURRED", null, {
edit: true
});
};
}
}
};
}
module.exports = Love;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Mission extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Mission extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Mission extends Command {
}]
});
}
};
}
module.exports = Mission;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
canvacord = require("canvacord");
class Phcomment extends Command {
@ -14,7 +13,7 @@ class Phcomment extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -22,17 +21,15 @@ class Phcomment extends Command {
let user = await this.client.resolveUser(args[0]);
let text = args.join(" ");
if (user) {
text = args.slice(1).join(" ");
} else {
user = message.author;
};
if (user) text = args.slice(1).join(" ");
else user = message.author;
if (!text) return message.error("images/phcomment:MISSING_TEXT");
const m = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading"
});
try {
const buffer = await canvacord.Canvas.phub({
username: user.username,
@ -53,8 +50,8 @@ class Phcomment extends Command {
m.error("misc:ERROR_OCCURRED", null, {
edit: true
});
};
}
}
};
}
module.exports = Phcomment;

View file

@ -33,8 +33,7 @@ class Qrcode extends Command {
content: message.translate("images/qrcode:SUCCESS"),
embeds: [embed]
});
}
};
}
module.exports = Qrcode;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Rip extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Rip extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Rip extends Command {
}]
});
}
};
}
module.exports = Rip;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Scary extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Scary extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Scary extends Command {
}]
});
}
};
}
module.exports = Scary;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Tobecontinued extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Tobecontinued extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Tobecontinued extends Command {
}]
});
}
};
}
module.exports = Tobecontinued;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
canvacord = require("canvacord");
class Trash extends Command {
@ -14,7 +13,7 @@ class Trash extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -35,6 +34,6 @@ class Trash extends Command {
}]
});
}
};
}
module.exports = Trash;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Triggered extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Triggered extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -38,6 +37,6 @@ class Triggered extends Command {
}]
});
}
};
}
module.exports = Triggered;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Tweet extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Tweet extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -47,6 +46,6 @@ class Tweet extends Command {
}]
});
}
};
}
module.exports = Tweet;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Wanted extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Wanted extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Wanted extends Command {
}]
});
}
};
}
module.exports = Wanted;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
const Command = require("../../base/Command.js");
class Wasted extends Command {
constructor(client) {
@ -13,7 +12,7 @@ class Wasted extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -36,6 +35,6 @@ class Wasted extends Command {
}]
});
}
};
}
module.exports = Wasted;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
canvacord = require("canvacord");
class YouTubeComment extends Command {
@ -14,7 +13,7 @@ class YouTubeComment extends Command {
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 5000
cooldown: 3000
});
}
@ -22,11 +21,8 @@ class YouTubeComment extends Command {
let user = await this.client.resolveUser(args[0]);
let text = args.join(" ");
if (user) {
text = args.slice(1).join(" ");
} else {
user = message.author;
};
if (user) text = args.slice(1).join(" ");
else user = message.author;
if (!text) return message.error("images/phcomment:MISSING_TEXT"); // same text as phcomment
@ -48,6 +44,6 @@ class YouTubeComment extends Command {
}]
});
}
};
}
module.exports = YouTubeComment;

View file

@ -38,7 +38,7 @@ class Announcement extends Command {
tmsg.delete();
msg.delete();
collector.stop(true);
};
}
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
tmsg.delete();
@ -63,12 +63,12 @@ class Announcement extends Command {
m.delete();
collector.stop(true);
c.stop(true);
};
}
});
c.on("end", (collected, reason) => {
if (reason === "time") return message.error("misc:TIMES_UP");
});
};
}
});
collector.on("end", (collected, reason) => {
@ -91,6 +91,6 @@ class Announcement extends Command {
});
});
}
};
}
module.exports = Announcement;

View file

@ -44,7 +44,7 @@ class Ban extends Command {
const moderationPosition = message.member.roles.highest.position;
if (message.member.ownerId !== message.author.id && !(moderationPosition > memberPosition)) return message.error("moderation/ban:SUPERIOR");
if (!member.bannable) return message.error("moderation/ban:MISSING_PERM");
};
}
await user.send(message.translate("moderation/ban:BANNED_DM", {
username: user.tag,
@ -77,7 +77,7 @@ class Ban extends Command {
if (memberData) {
memberData.sanctions.push(caseInfo);
memberData.save();
};
}
data.guild.casesCount++;
data.guild.save();
@ -98,13 +98,13 @@ class Ban extends Command {
channel.send({
embeds: [embed]
});
};
}
}).catch((err) => {
console.log(err);
return message.error("moderation/ban:MISSING_PERM");
});
}
};
}
module.exports = Ban;

View file

@ -33,7 +33,7 @@ class Clear extends Command {
return newChannel.send({
content: message.translate("moderation/clear:CHANNEL_CLEARED")
});
};
}
let amount = args[0];
if (!amount || isNaN(amount) || parseInt(amount) < 1) return message.error("moderation/clear:MISSING_AMOUNT");
@ -64,12 +64,12 @@ class Clear extends Command {
toDelete = await message.success("moderation/clear:CLEARED", {
amount: `${--amount} ${message.getNoun(--amount, message.translate("misc:NOUNS:MESSAGES:1"), message.translate("misc:NOUNS:MESSAGES:2"), message.translate("misc:NOUNS:MESSAGES:5"))}`
});
};
}
setTimeout(function () {
toDelete.delete();
}, 2000);
}
};
}
module.exports = Clear;

View file

@ -30,6 +30,6 @@ class Clearwarns extends Command {
username: member.user.tag
});
}
};
}
module.exports = Clearwarns;

Some files were not shown because too many files have changed in this diff Show more