mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
beautify
This commit is contained in:
parent
8e1418b58f
commit
e942aedad7
159 changed files with 1989 additions and 1077 deletions
55
base/JaBa.js
55
base/JaBa.js
|
@ -19,7 +19,7 @@ moment.relativeTimeThreshold("M", 12);
|
|||
|
||||
// Creates JaBa class
|
||||
class JaBa extends Client {
|
||||
constructor (options) {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this.config = require("../config"); // Load the config file
|
||||
this.customEmojis = require("../emojis.json"); // load the bot's emojis
|
||||
|
@ -47,7 +47,9 @@ class JaBa extends Client {
|
|||
this.databaseCache.mutedUsers = new Collection(); // members who are currently muted
|
||||
|
||||
if (this.config.apiKeys.amethyste) this.AmeAPI = new AmeClient(this.config.apiKeys.amethyste);
|
||||
if (this.config.apiKeys.blagueXYZ) this.joker = new Joker(this.config.apiKeys.blagueXYZ, { defaultLanguage: "en" });
|
||||
if (this.config.apiKeys.blagueXYZ) this.joker = new Joker(this.config.apiKeys.blagueXYZ, {
|
||||
defaultLanguage: "en"
|
||||
});
|
||||
|
||||
this.player = new DisTube.default(this, {
|
||||
searchSongs: 10,
|
||||
|
@ -56,7 +58,7 @@ class JaBa extends Client {
|
|||
emptyCooldown: 0,
|
||||
leaveOnFinish: true,
|
||||
leaveOnStop: true,
|
||||
plugins: [ new SoundCloudPlugin(), new SpotifyPlugin() ],
|
||||
plugins: [new SoundCloudPlugin(), new SpotifyPlugin()],
|
||||
});
|
||||
|
||||
this.player
|
||||
|
@ -73,11 +75,13 @@ class JaBa extends Client {
|
|||
})
|
||||
.on("searchDone", () => {})
|
||||
.on("searchCancel", message => message.error("misc:TIMES_UP"))
|
||||
.on("searchInvalidAnswer", message => message.error("misc:INVALID_NUMBER_RANGE", { min: 1, max: tracks.length }))
|
||||
.on("searchInvalidAnswer", message => message.error("misc:INVALID_NUMBER_RANGE", { min: 1, max: 10 }))
|
||||
.on("searchNoResult", message => message.error("music/play:NO_RESULT"))
|
||||
.on("error", (textChannel, e) => {
|
||||
console.error(e);
|
||||
textChannel.send(this.translate("music/play:ERR_OCCURRED", { error: e }));
|
||||
textChannel.send(this.translate("music/play:ERR_OCCURRED", {
|
||||
error: e
|
||||
}));
|
||||
})
|
||||
.on("finish", queue => queue.textChannel.send(this.translate("music/play:QUEUE_ENDED")))
|
||||
.on("disconnect", queue => queue.textChannel.send(this.translate("music/play:STOP_DISCONNECTED")))
|
||||
|
@ -129,7 +133,7 @@ class JaBa extends Client {
|
|||
// This function is used to load a command and add it to the collection
|
||||
loadCommand(commandPath, commandName) {
|
||||
try {
|
||||
const props = new (require(`.${commandPath}${path.sep}${commandName}`))(this);
|
||||
const props = new(require(`.${commandPath}${path.sep}${commandName}`))(this);
|
||||
this.logger.log(`Loading Command: ${props.help.name}. 👌`, "log");
|
||||
props.conf.location = commandPath;
|
||||
if (props.init) props.init(this);
|
||||
|
@ -146,7 +150,7 @@ class JaBa extends Client {
|
|||
};
|
||||
|
||||
// This function is used to unload a command (you need to load them again)
|
||||
async unloadCommand (commandPath, commandName) {
|
||||
async unloadCommand(commandPath, commandName) {
|
||||
let command;
|
||||
if (this.commands.has(commandName)) command = this.commands.get(commandName);
|
||||
else if (this.aliases.has(commandName)) command = this.commands.get(this.aliases.get(commandName));
|
||||
|
@ -163,13 +167,19 @@ class JaBa extends Client {
|
|||
async findOrCreateUser({ id: userID }, isLean) {
|
||||
if (this.databaseCache.users.get(userID)) return isLean ? this.databaseCache.users.get(userID).toJSON() : this.databaseCache.users.get(userID);
|
||||
else {
|
||||
let userData = (isLean ? await this.usersData.findOne({ id: userID }).lean() : await this.usersData.findOne({ id: userID }));
|
||||
let userData = (isLean ? await this.usersData.findOne({
|
||||
id: userID
|
||||
}).lean() : await this.usersData.findOne({
|
||||
id: userID
|
||||
}));
|
||||
if (userData) {
|
||||
if (!isLean) this.databaseCache.users.set(userID, userData);
|
||||
|
||||
return userData;
|
||||
} else {
|
||||
userData = new this.usersData({ id: userID });
|
||||
userData = new this.usersData({
|
||||
id: userID
|
||||
});
|
||||
await userData.save();
|
||||
this.databaseCache.users.set(userID, userData);
|
||||
|
||||
|
@ -182,15 +192,26 @@ class JaBa extends Client {
|
|||
async findOrCreateMember({ id: memberID, guildID }, isLean) {
|
||||
if (this.databaseCache.members.get(`${memberID}${guildID}`)) return isLean ? this.databaseCache.members.get(`${memberID}${guildID}`).toJSON() : this.databaseCache.members.get(`${memberID}${guildID}`);
|
||||
else {
|
||||
let memberData = (isLean ? await this.membersData.findOne({ guildID, id: memberID }).lean() : await this.membersData.findOne({ guildID, id: memberID }));
|
||||
let memberData = (isLean ? await this.membersData.findOne({
|
||||
guildID,
|
||||
id: memberID
|
||||
}).lean() : await this.membersData.findOne({
|
||||
guildID,
|
||||
id: memberID
|
||||
}));
|
||||
if (memberData) {
|
||||
if (!isLean) this.databaseCache.members.set(`${memberID}${guildID}`, memberData);
|
||||
|
||||
return memberData;
|
||||
} else {
|
||||
memberData = new this.membersData({ id: memberID, guildID: guildID });
|
||||
memberData = new this.membersData({
|
||||
id: memberID,
|
||||
guildID: guildID
|
||||
});
|
||||
await memberData.save();
|
||||
const guild = await this.findOrCreateGuild({ id: guildID });
|
||||
const guild = await this.findOrCreateGuild({
|
||||
id: guildID
|
||||
});
|
||||
if (guild) {
|
||||
guild.members.push(memberData._id);
|
||||
await guild.save();
|
||||
|
@ -206,13 +227,19 @@ class JaBa extends Client {
|
|||
async findOrCreateGuild({ id: guildID }, isLean) {
|
||||
if (this.databaseCache.guilds.get(guildID)) return isLean ? this.databaseCache.guilds.get(guildID).toJSON() : this.databaseCache.guilds.get(guildID);
|
||||
else {
|
||||
let guildData = (isLean ? await this.guildsData.findOne({ id: guildID }).populate("members").lean() : await this.guildsData.findOne({ id: guildID }).populate("members"));
|
||||
let guildData = (isLean ? await this.guildsData.findOne({
|
||||
id: guildID
|
||||
}).populate("members").lean() : await this.guildsData.findOne({
|
||||
id: guildID
|
||||
}).populate("members"));
|
||||
if (guildData) {
|
||||
if (!isLean) this.databaseCache.guilds.set(guildID, guildData);
|
||||
|
||||
return guildData;
|
||||
} else {
|
||||
guildData = new this.guildsData({ id: guildID });
|
||||
guildData = new this.guildsData({
|
||||
id: guildID
|
||||
});
|
||||
await guildData.save();
|
||||
this.databaseCache.guilds.set(guildID, guildData);
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Addcommand extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "addcommand",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "custom-command" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["custom-command"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (!args[0]) return message.error("administration/addcommand:MISSING_NAME");
|
||||
|
||||
const name = args[0].split("\n")[0];
|
||||
|
@ -32,7 +32,10 @@ class Addcommand extends Command {
|
|||
});
|
||||
data.guild.save();
|
||||
|
||||
message.success("administration/addcommand:SUCCESS", { commandName: name, prefix: data.guild.prefix });
|
||||
message.success("administration/addcommand:SUCCESS", {
|
||||
commandName: name,
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Addemoji extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "addemoji",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const URL = args[0];
|
||||
if (!URL) return message.error("administration/addemoji:MISSING_URL");
|
||||
|
||||
|
@ -26,12 +26,8 @@ class Addemoji extends Command {
|
|||
|
||||
message.guild.emojis
|
||||
.create(URL, name)
|
||||
.then(emoji => {
|
||||
message.success("administration/addemoji:SUCCESS", { emojiName: emoji.name });
|
||||
})
|
||||
.catch(() => {
|
||||
message.error("administration/addemoji:ERROR", { emojiName: name });
|
||||
});
|
||||
.then(emoji => message.success("administration/addemoji:SUCCESS", { emojiName: emoji.name }))
|
||||
.catch(() => message.error("administration/addemoji:ERROR", { emojiName: name }));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,39 +1,49 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Automod extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "automod",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args,data) {
|
||||
async run(message, args, data) {
|
||||
const status = args[0];
|
||||
if (!status || (status !== "on" && status !== "off")) return message.error("administration/automod:MISSING_STATUS");
|
||||
|
||||
if (status === "on") {
|
||||
data.guild.plugins.automod = { enabled: true, ignored: [] };
|
||||
data.guild.plugins.automod = {
|
||||
enabled: true,
|
||||
ignored: []
|
||||
};
|
||||
data.guild.markModified("plugins.automod");
|
||||
data.guild.save();
|
||||
message.success("administration/automod:ENABLED", { prefix: data.guild.prefix });
|
||||
message.success("administration/automod:ENABLED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
} else if (status === "off") {
|
||||
if (message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first()) {
|
||||
const channel = message.mentions.channels.first();
|
||||
data.guild.plugins.automod.ignored.push(channel);
|
||||
data.guild.markModified("plugins.automod");
|
||||
data.guild.save();
|
||||
message.success("administration/automod:DISABLED_CHANNEL", { channel: channel.toString() });
|
||||
message.success("administration/automod:DISABLED_CHANNEL", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
} else {
|
||||
data.guild.plugins.automod = { enabled: false, ignored: [] };
|
||||
data.guild.plugins.automod = {
|
||||
enabled: false,
|
||||
ignored: []
|
||||
};
|
||||
data.guild.markModified("plugins.automod");
|
||||
data.guild.save();
|
||||
message.success("administration/automod:DISABLED");
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Autorole extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "autorole",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "ar" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["ar"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const status = args[0];
|
||||
if (status !== "on" && status !== "off") return message.error("administration/autorole:MISSING_STATUS");
|
||||
|
||||
|
@ -39,7 +39,9 @@ class Autorole extends Command {
|
|||
roleName: role.name
|
||||
});
|
||||
} else if (status === "off") {
|
||||
if (!data.guild.plugins.autorole.enabled) return message.success("administration/autorole:ALREADY_DISABLED", { prefix: data.guild.prefix });
|
||||
if (!data.guild.plugins.autorole.enabled) return message.success("administration/autorole:ALREADY_DISABLED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
|
||||
data.guild.plugins.autorole = {
|
||||
enabled: false,
|
||||
|
@ -48,7 +50,9 @@ class Autorole extends Command {
|
|||
data.guild.markModified("plugins.autorole");
|
||||
await data.guild.save();
|
||||
|
||||
message.success("administration/autorole:SUCCESS_DISABLED", { prefix: data.guild.prefix });
|
||||
message.success("administration/autorole:SUCCESS_DISABLED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4,31 +4,35 @@ const Command = require("../../base/Command.js"),
|
|||
Sentry = require("@sentry/node");
|
||||
|
||||
class Backup extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "backup",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ADMINISTRATOR" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ADMINISTRATOR"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 30000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const status = args[0];
|
||||
if (!status) return message.error("administration/backup:MISSING_STATUS");
|
||||
|
||||
if (status === "create") {
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
backup.create(message.guild).then((backup) => {
|
||||
m.delete();
|
||||
message.success("administration/backup:SUCCESS_PUBLIC");
|
||||
message.author.send(message.translate("administration/backup:SUCCESS_PRIVATE", { backupID: backup.id })).catch(() => {
|
||||
message.author.send(message.translate("administration/backup:SUCCESS_PRIVATE", {
|
||||
backupID: backup.id
|
||||
})).catch(() => {
|
||||
backup.remove(backup.id);
|
||||
message.error("misc:CANNOT_DM");
|
||||
});
|
||||
|
@ -88,7 +92,9 @@ class Backup extends Command {
|
|||
message.channel.send(embed);
|
||||
}).catch(() => {
|
||||
// if the backup wasn't found
|
||||
return message.error("administration/backup:NO_BACKUP_FOUND", { backupID });
|
||||
return message.error("administration/backup:NO_BACKUP_FOUND", {
|
||||
backupID
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return message.error("administration/backup:MISSING_STATUS");
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Configuration extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "configuration",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "conf", "config" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["conf", "config"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const guildData = data.guild;
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
|
@ -32,13 +32,21 @@ class Configuration extends Command {
|
|||
embed.addField(message.translate("administration/configuration:IGNORED_CHANNELS_TITLE"), guildData.ignoredChannels.length > 0 ? guildData.ignoredChannels.map((ch) => `<#${ch}>`).join(", ") : message.translate("administration/configuration:NO_IGNORED_CHANNELS"));
|
||||
|
||||
// Autorole plugin
|
||||
embed.addField(message.translate("administration/configuration:AUTOROLE_TITLE"), guildData.plugins.autorole.enabled ? message.translate("administration/configuration:AUTOROLE_CONTENT", { roleName: `<@&${guildData.plugins.autorole.role}>` }) : message.translate("administration/configuration:AUTOROLE_DISABLED"));
|
||||
embed.addField(message.translate("administration/configuration:AUTOROLE_TITLE"), guildData.plugins.autorole.enabled ? message.translate("administration/configuration:AUTOROLE_CONTENT", {
|
||||
roleName: `<@&${guildData.plugins.autorole.role}>`
|
||||
}) : message.translate("administration/configuration:AUTOROLE_DISABLED"));
|
||||
|
||||
// Welcome plugin
|
||||
embed.addField(message.translate("administration/configuration:WELCOME_TITLE"), guildData.plugins.welcome.enabled ? message.translate("administration/configuration:WELCOME_CONTENT", { channel: `<#${guildData.plugins.welcome.channel}>`, withImage: guildData.plugins.welcome.withImage ? message.translate("common:YES") : message.translate("common:NO") }) : message.translate("administration/configuration:WELCOME_DISABLED"));
|
||||
embed.addField(message.translate("administration/configuration:WELCOME_TITLE"), guildData.plugins.welcome.enabled ? message.translate("administration/configuration:WELCOME_CONTENT", {
|
||||
channel: `<#${guildData.plugins.welcome.channel}>`,
|
||||
withImage: guildData.plugins.welcome.withImage ? message.translate("common:YES") : message.translate("common:NO")
|
||||
}) : message.translate("administration/configuration:WELCOME_DISABLED"));
|
||||
|
||||
// Goodbye plugin
|
||||
embed.addField(message.translate("administration/configuration:GOODBYE_TITLE"), guildData.plugins.goodbye.enabled ? message.translate("administration/configuration:GOODBYE_CONTENT", { channel: `<#${guildData.plugins.goodbye.channel}>`, withImage: guildData.plugins.goodbye.withImage ? message.translate("common:YES") : message.translate("common:NO") }) : message.translate("administration/configuration:GOODBYE_DISABLED"));
|
||||
embed.addField(message.translate("administration/configuration:GOODBYE_TITLE"), guildData.plugins.goodbye.enabled ? message.translate("administration/configuration:GOODBYE_CONTENT", {
|
||||
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
||||
withImage: guildData.plugins.goodbye.withImage ? message.translate("common:YES") : message.translate("common:NO")
|
||||
}) : message.translate("administration/configuration:GOODBYE_DISABLED"));
|
||||
|
||||
// Special channels
|
||||
embed.addField(message.translate("administration/configuration:SPECIAL_CHANNELS"),
|
||||
|
@ -57,10 +65,16 @@ class Configuration extends Command {
|
|||
);
|
||||
|
||||
// Auto sanctions
|
||||
embed.addField(message.translate("administration/configuration:AUTO_SANCTIONS"), (guildData.plugins.warnsSanctions.kick ? message.translate("administration/configuration:KICK_CONTENT", { count: guildData.plugins.warnsSanctions.kick }) : message.translate("administration/configuration:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? message.translate("administration/configuration:BAN_CONTENT", { count: guildData.plugins.warnsSanctions.ban }) : message.translate("administration/configuration:BAN_NOT_DEFINED")));
|
||||
embed.addField(message.translate("administration/configuration:AUTO_SANCTIONS"), (guildData.plugins.warnsSanctions.kick ? message.translate("administration/configuration:KICK_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.kick
|
||||
}) : message.translate("administration/configuration:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? message.translate("administration/configuration:BAN_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.ban
|
||||
}) : message.translate("administration/configuration:BAN_NOT_DEFINED")));
|
||||
|
||||
// Automod plugin
|
||||
embed.addField(message.translate("administration/configuration:AUTOMOD_TITLE"), guildData.plugins.automod.enabled ? message.translate("administration/configuration:AUTOMOD_CONTENT", { channels: guildData.plugins.automod.ignored.map((ch) => `<#${ch}>`) }) : message.translate("administration/configuration:AUTOMOD_DISABLED"));
|
||||
embed.addField(message.translate("administration/configuration:AUTOMOD_TITLE"), guildData.plugins.automod.enabled ? message.translate("administration/configuration:AUTOMOD_CONTENT", {
|
||||
channels: guildData.plugins.automod.ignored.map((ch) => `<#${ch}>`)
|
||||
}) : message.translate("administration/configuration:AUTOMOD_DISABLED"));
|
||||
|
||||
// Auto-delete mod commands
|
||||
embed.addField(message.translate("administration/configuration:AUTODELETEMOD"), guildData.autoDeleteModCommands ? message.translate("administration/configuration:AUTODELETEMOD_ENABLED") : message.translate("administration/configuration:AUTODELETEMOD_DISABLED"));
|
||||
|
|
|
@ -1,31 +1,32 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Delcommand extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "delcommand",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const name = args[0];
|
||||
if (!name) return message.error("administration/delcommand:MISSING_NAME");
|
||||
|
||||
if (!data.guild.customCommands.find((c) => c.name === name)) return message.error("administration/delcommand:UNKNOWN_COMMAND", { commandName: name });
|
||||
|
||||
data.guild.customCommands = data.guild.customCommands.filter((c) => c.name !== name);
|
||||
data.guild.save();
|
||||
|
||||
message.success("administration/delcommand:SUCCESS", { commandName: name });
|
||||
message.success("administration/delcommand:SUCCESS", {
|
||||
commandName: name
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Deletemod extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "deletemod",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "autodeletemodcommands" ],
|
||||
memberPermissions: [ "MANAGE_MESSAGES" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["autodeletemodcommands"],
|
||||
memberPermissions: ["MANAGE_MESSAGES"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const status = args[0];
|
||||
if (!status || status !== "on" && status !== "off") return message.error("administration/deletemod:MISSING_STATUS");
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Goodbye extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "goodbye",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "au-revoir" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["au-revoir"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (args[0] === "test" && data.guild.plugins.goodbye.enabled) {
|
||||
this.client.emit("guildMemberRemove", message.member);
|
||||
return message.success("administration/goodbye:TEST_SUCCESS");
|
||||
|
@ -34,7 +34,9 @@ class Goodbye extends Command {
|
|||
};
|
||||
data.guild.markModified("plugins.goodbye");
|
||||
data.guild.save();
|
||||
return message.error("administration/goodbye:DISABLED", { prefix: data.guild.prefix });
|
||||
return message.error("administration/goodbye:DISABLED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
} else {
|
||||
const goodbye = {
|
||||
enabled: true,
|
||||
|
@ -43,7 +45,10 @@ class Goodbye extends Command {
|
|||
withImage: null,
|
||||
};
|
||||
|
||||
message.sendT("administration/goodbye:FORM_1", { author: message.author.toString() });
|
||||
message.sendT("administration/goodbye:FORM_1", {
|
||||
author: message.author.toString()
|
||||
});
|
||||
|
||||
const collector = message.channel.createMessageCollector(m => m.author.id === message.author.id, {
|
||||
time: 120000 // 2 minutes
|
||||
});
|
||||
|
@ -61,7 +66,10 @@ class Goodbye extends Command {
|
|||
data.guild.plugins.goodbye = goodbye;
|
||||
data.guild.markModified("plugins.goodbye");
|
||||
await data.guild.save();
|
||||
message.sendT("administration/goodbye:FORM_SUCCESS", { prefix: data.guild.prefix, channel: `<#${goodbye.channel}>` });
|
||||
message.sendT("administration/goodbye:FORM_SUCCESS", {
|
||||
prefix: data.guild.prefix,
|
||||
channel: `<#${goodbye.channel}>`
|
||||
});
|
||||
return collector.stop();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Ignore extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "ignore",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "disableChannel" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["disableChannel"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first();
|
||||
if (!channel) return message.error("misc:INVALID_CHANNEL");
|
||||
|
||||
|
@ -25,11 +25,15 @@ class Ignore extends Command {
|
|||
if (ignored) {
|
||||
data.guild.ignoredChannels = data.guild.ignoredChannels.filter((ch) => ch !== channel.id);
|
||||
data.guild.save();
|
||||
return message.success("administration/ignore:ALLOWED", { channel: channel.toString() });
|
||||
return message.success("administration/ignore:ALLOWED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
} else if (!ignored) {
|
||||
data.guild.ignoredChannels.push(channel.id);
|
||||
data.guild.save();
|
||||
return message.success("administration/ignore:IGNORED", { channel: channel.toString() });
|
||||
return message.success("administration/ignore:IGNORED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Set extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "set",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const status = args[0];
|
||||
if (!status || !["level", "xp", "credits", "bank"].includes(status)) return message.error("administration/set:NO_STATUS");
|
||||
|
||||
|
@ -28,7 +28,10 @@ class Set extends Command {
|
|||
if (!number || isNaN(number) || parseInt(number, 10) <= 0) return message.error("administration/set:INVALID_AMOUNT");
|
||||
const amount = Math.ceil(parseInt(number, 10));
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
|
||||
if (status === "level") {
|
||||
memberData.level = parseInt(amount, 10);
|
||||
|
@ -44,7 +47,10 @@ class Set extends Command {
|
|||
memberData.save();
|
||||
}
|
||||
|
||||
message.success("administration/set:SUCCESS_" + status.toUpperCase() , { username: member.user.tag, amount });
|
||||
message.success("administration/set:SUCCESS_" + status.toUpperCase(), {
|
||||
username: member.user.tag,
|
||||
amount
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ class Setfortniteshop extends Command {
|
|||
data.guild.markModified("plugins.fortniteshop");
|
||||
data.guild.save();
|
||||
|
||||
message.success("administration/setfortniteshop:ENABLED", { channel: channel.toString() });
|
||||
message.success("administration/setfortniteshop:ENABLED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
|
||||
const momentName = this.client.languages.find((language) => language.name === data.guild.language || language.aliases.includes(data.guild.language)).moment;
|
||||
const shop = new Canvas.FortniteShop();
|
||||
|
@ -51,7 +53,13 @@ class Setfortniteshop extends Command {
|
|||
const attachment = new Discord.MessageAttachment(image, "shop.png");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(this.client.translate("general/fortniteshop:DATE", { date: this.client.printDate(new Date(Date.now()), null, message.guild.data.language) }, message.guild.data.language), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(this.client.translate("general/fortniteshop:DATE", {
|
||||
date: this.client.printDate(new Date(Date.now()), null, message.guild.data.language)
|
||||
}, message.guild.data.language), this.client.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.attachFiles(attachment)
|
||||
.setImage("attachment://shop.png")
|
||||
.setColor(this.client.config.embed.color)
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Setlang extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setlang",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const language = this.client.languages.find((l) => l.name === args[0] || l.aliases.includes(args[0]));
|
||||
|
||||
if (!args[0] || !language) return message.error("administration/setlang:MISSING_LANG", { list: this.client.languages.map((l) => `\`${l.name}\``).join(", ") });
|
||||
|
@ -24,7 +24,9 @@ class Setlang extends Command {
|
|||
data.guild.language = language.name;
|
||||
await data.guild.save();
|
||||
|
||||
return message.sendT("administration/setlang:SUCCESS", { lang: language.nativeName });
|
||||
return message.sendT("administration/setlang:SUCCESS", {
|
||||
lang: language.nativeName
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,24 +2,28 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Setmodlogs extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setmodlogs",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "setmodlogs" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["setmodlogs"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const areModLogsEnabled = Boolean(data.guild.plugins.modlogs);
|
||||
const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), channelType: "text" });
|
||||
const sentChannel = await Resolvers.resolveChannel({
|
||||
message,
|
||||
search: args.join(" "),
|
||||
channelType: "text"
|
||||
});
|
||||
|
||||
if (!sentChannel && areModLogsEnabled) {
|
||||
data.guild.plugins.modlogs = null;
|
||||
|
@ -31,7 +35,9 @@ class Setmodlogs extends Command {
|
|||
data.guild.plugins.modlogs = channel.id;
|
||||
data.guild.markModified("plugins.modlogs");
|
||||
await data.guild.save();
|
||||
return message.success("administration/setmodlogs:SUCCESS_ENABLED", { channel: channel.toString() });
|
||||
return message.success("administration/setmodlogs:SUCCESS_ENABLED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Setprefix extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setprefix",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const prefix = args[0];
|
||||
if (!prefix) return message.error("administration/setprefix:MISSING_PREFIX");
|
||||
if (prefix.length > 5) return message.error("administration/setprefix:TOO_LONG");
|
||||
|
@ -24,8 +24,9 @@ class Setprefix extends Command {
|
|||
data.guild.prefix = prefix;
|
||||
data.guild.save();
|
||||
|
||||
// Sucess
|
||||
return message.success("administration/setprefix:SUCCESS", { prefix });
|
||||
return message.success("administration/setprefix:SUCCESS", {
|
||||
prefix
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,24 +2,28 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Setreports extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setreports",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "setreport"],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["setreport"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const areReportsEnabled = Boolean(data.guild.plugins.reports);
|
||||
const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), channelType: "text" });
|
||||
const sentChannel = await Resolvers.resolveChannel({
|
||||
message,
|
||||
search: args.join(" "),
|
||||
channelType: "text"
|
||||
});
|
||||
|
||||
if (!sentChannel && areReportsEnabled) {
|
||||
data.guild.plugins.reports = null;
|
||||
|
@ -31,7 +35,9 @@ class Setreports extends Command {
|
|||
data.guild.plugins.reports = channel.id;
|
||||
data.guild.markModified("plugins.reports");
|
||||
await data.guild.save();
|
||||
return message.success("administration/setreports:SUCCESS_ENABLED", { channel: channel.toString() });
|
||||
return message.success("administration/setreports:SUCCESS_ENABLED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,24 +2,28 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Setsuggests extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setsuggests",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "setsuggest", "setsuggestions", "setsuggestion" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["setsuggest", "setsuggestions", "setsuggestion"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const areSuggestsEnabled = Boolean(data.guild.plugins.suggestions);
|
||||
const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), channelType: "text" });
|
||||
const sentChannel = await Resolvers.resolveChannel({
|
||||
message,
|
||||
search: args.join(" "),
|
||||
channelType: "text"
|
||||
});
|
||||
|
||||
if (!sentChannel && areSuggestsEnabled) {
|
||||
data.guild.plugins.suggestions = null;
|
||||
|
@ -31,7 +35,9 @@ class Setsuggests extends Command {
|
|||
data.guild.plugins.suggestions = channel.id;
|
||||
data.guild.markModified("plugins.suggestions");
|
||||
await data.guild.save();
|
||||
return message.success("administration/setsuggests:SUCCESS_ENABLED", { channel: channel.toString() });
|
||||
return message.success("administration/setsuggests:SUCCESS_ENABLED", {
|
||||
channel: channel.toString()
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
ms = require("ms");
|
||||
|
||||
class Slowmode extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "slowmode",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "slowmotion" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["slowmotion"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first();
|
||||
if (!channel) return message.error("misc:INVALID_CHANNEL");
|
||||
|
||||
|
@ -28,7 +28,10 @@ class Slowmode extends Command {
|
|||
data.guild.slowmode.channels = data.guild.slowmode.channels.filter((ch) => ch.id !== channel.id);
|
||||
data.guild.markModified("slowmode.channels");
|
||||
data.guild.save();
|
||||
message.success("administration/slowmode:DISABLED", { prefix: data.guild.prefix, channel: `#${channel.name}` });
|
||||
message.success("administration/slowmode:DISABLED", {
|
||||
prefix: data.guild.prefix,
|
||||
channel: `#${channel.name}`
|
||||
});
|
||||
} else {
|
||||
if (isNaN(ms(time))) return message.error("misc:INVALID_TIME");
|
||||
if (data.guild.slowmode.channels.find((ch) => ch.id === channel.id)) data.guild.slowmode.channels = data.guild.slowmode.channels.filter((ch) => ch.id !== channel.id);
|
||||
|
@ -39,7 +42,11 @@ class Slowmode extends Command {
|
|||
});
|
||||
data.guild.markModified("slowmode.channels");
|
||||
data.guild.save();
|
||||
message.success("administration/slowmode:ENABLED", { prefix: data.guild.prefix, channel: `#${channel.name}`, time: this.client.functions.convertTime(message.guild, ms(time)) });
|
||||
message.success("administration/slowmode:ENABLED", {
|
||||
prefix: data.guild.prefix,
|
||||
channel: `#${channel.name}`,
|
||||
time: this.client.functions.convertTime(message.guild, ms(time))
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Resolvers = require("../../helpers/resolvers");
|
||||
|
||||
class Welcome extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "welcome",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "bienvenue" ],
|
||||
memberPermissions: [ "MANAGE_GUILD" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["bienvenue"],
|
||||
memberPermissions: ["MANAGE_GUILD"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (args[0] === "test" && data.guild.plugins.welcome.enabled) {
|
||||
this.client.emit("guildMemberAdd", message.member);
|
||||
return message.success("administration/welcome:TEST_SUCCESS");
|
||||
|
@ -34,7 +34,9 @@ class Welcome extends Command {
|
|||
};
|
||||
data.guild.markModified("plugins.welcome");
|
||||
data.guild.save();
|
||||
return message.error("administration/welcome:DISABLED", { prefix: data.guild.prefix });
|
||||
return message.error("administration/welcome:DISABLED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
} else {
|
||||
const welcome = {
|
||||
enabled: true,
|
||||
|
@ -43,7 +45,9 @@ class Welcome extends Command {
|
|||
withImage: null,
|
||||
};
|
||||
|
||||
message.sendT("administration/welcome:FORM_1", { author: message.author.toString() });
|
||||
message.sendT("administration/welcome:FORM_1", {
|
||||
author: message.author.toString()
|
||||
});
|
||||
const collector = message.channel.createMessageCollector(m => m.author.id === message.author.id, {
|
||||
time: 120000 // 2 minutes
|
||||
});
|
||||
|
@ -61,7 +65,10 @@ class Welcome extends Command {
|
|||
data.guild.plugins.welcome = welcome;
|
||||
data.guild.markModified("plugins.welcome");
|
||||
await data.guild.save();
|
||||
message.sendT("administration/welcome:FORM_SUCCESS", { prefix: data.guild.prefix, channel: `<#${welcome.channel}>` });
|
||||
message.sendT("administration/welcome:FORM_SUCCESS", {
|
||||
prefix: data.guild.prefix,
|
||||
channel: `<#${welcome.channel}>`
|
||||
});
|
||||
return collector.stop();
|
||||
};
|
||||
|
||||
|
@ -76,7 +83,10 @@ class Welcome extends Command {
|
|||
|
||||
// If the channel is not filled, it means the user sent it
|
||||
if (!welcome.channel) {
|
||||
const channel = await Resolvers.resolveChannel({ message: msg, channelType: "text" });
|
||||
const channel = await Resolvers.resolveChannel({
|
||||
message: msg,
|
||||
channelType: "text"
|
||||
});
|
||||
if (!channel) return message.error("misc:INVALID_CHANNEL");
|
||||
|
||||
welcome.channel = channel.id;
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Achievements extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "achievements",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "ac" ],
|
||||
aliases: ["ac"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("economy/achievements:TITLE"))
|
||||
.setColor(data.config.embed.color)
|
||||
|
@ -26,37 +26,37 @@ class Achievements extends Command {
|
|||
embed.addField(message.translate("economy/achievements:SEND_CMD"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.firstCommand.progress.now,
|
||||
total: data.userData.achievements.firstCommand.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.firstCommand.progress.now/data.userData.achievements.firstCommand.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.firstCommand.progress.now / data.userData.achievements.firstCommand.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:CLAIM_SALARY"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.work.progress.now,
|
||||
total: data.userData.achievements.work.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.work.progress.now/data.userData.achievements.work.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.work.progress.now / data.userData.achievements.work.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:MARRY"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.married.progress.now,
|
||||
total: data.userData.achievements.married.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.married.progress.now/data.userData.achievements.married.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.married.progress.now / data.userData.achievements.married.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:SLOTS"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.slots.progress.now,
|
||||
total: data.userData.achievements.slots.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.slots.progress.now/data.userData.achievements.slots.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.slots.progress.now / data.userData.achievements.slots.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:TIP"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.tip.progress.now,
|
||||
total: data.userData.achievements.tip.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.tip.progress.now/data.userData.achievements.tip.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.tip.progress.now / data.userData.achievements.tip.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:REP"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.rep.progress.now,
|
||||
total: data.userData.achievements.rep.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.rep.progress.now/data.userData.achievements.rep.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.rep.progress.now / data.userData.achievements.rep.progress.total))
|
||||
}));
|
||||
embed.addField(message.translate("economy/achievements:INVITE"), message.translate("economy/achievements:PROGRESS", {
|
||||
now: data.userData.achievements.invite.progress.now,
|
||||
total: data.userData.achievements.invite.progress.total,
|
||||
percent: Math.round(100 * (data.userData.achievements.invite.progress.now/data.userData.achievements.invite.progress.total))
|
||||
percent: Math.round(100 * (data.userData.achievements.invite.progress.now / data.userData.achievements.invite.progress.total))
|
||||
}));
|
||||
|
||||
message.channel.send(embed);
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Birthdate extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "birthdate",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "anniversaire" ],
|
||||
aliases: ["anniversaire"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const date = args[0];
|
||||
if (!date) return message.error("economy/birthdate:MISSING_DATE");
|
||||
|
||||
|
@ -28,18 +28,21 @@ class Birthdate extends Command {
|
|||
const match = date.match(/\d+/g);
|
||||
if (!match) return message.error("economy/birthdate:INVALID_DATE_FORMAT");
|
||||
|
||||
const tday = +match[0], tmonth = +match[1] - 1;
|
||||
const tday = +match[0],
|
||||
tmonth = +match[1] - 1;
|
||||
let tyear = +match[2];
|
||||
if (tyear < 100) tyear += tyear < 50 ? 2000 : 1900;
|
||||
const d = new Date(tyear, tmonth, tday);
|
||||
if (!(tday == d.getDate() && tmonth == d.getMonth() && tyear == d.getFullYear())) return message.error("economy/birthdate:INVALID_DATE_FORMAT");
|
||||
if (d.getTime() > Date.now()) return message.error("economy/birthdate:DATE_TOO_HIGH");
|
||||
if (d.getTime() < (Date.now() - 2.523e+12))return message.error("economy/birthdate:DATE_TOO_LOW");
|
||||
if (d.getTime() < (Date.now() - 2.523e+12)) return message.error("economy/birthdate:DATE_TOO_LOW");
|
||||
|
||||
data.userData.birthdate = d;
|
||||
data.userData.save();
|
||||
|
||||
message.success("economy/birthdate:SUCCESS", { date: message.printDate(d)});
|
||||
message.success("economy/birthdate:SUCCESS", {
|
||||
date: message.printDate(d)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Deposit extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "deposit",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "bank", "banque", "dep" ],
|
||||
aliases: ["bank", "banque", "dep"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let amount = args[0];
|
||||
|
||||
if (!(parseInt(data.memberData.money, 10) > 0)) return message.error("economy/deposit:NO_CREDIT");
|
||||
|
@ -34,7 +34,9 @@ class Deposit extends Command {
|
|||
data.memberData.bankSold = data.memberData.bankSold + amount;
|
||||
data.memberData.save();
|
||||
|
||||
message.success("economy/deposit:SUCCESS", { money: amount });
|
||||
message.success("economy/deposit:SUCCESS", {
|
||||
money: amount
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,37 +1,38 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Divorce extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "divorce",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "profil" ],
|
||||
aliases: ["profil"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
// Check if the message author is wedded
|
||||
async run(message, args, data) {
|
||||
if (!data.userData.lover) return message.error("economy/divorce:NOT_MARRIED");
|
||||
|
||||
// Updates db
|
||||
const user = this.client.users.cache.get(data.userData.lover) || await this.client.users.fetch(data.userData.lover);
|
||||
|
||||
data.userData.lover = null;
|
||||
data.userData.save();
|
||||
|
||||
const oldLover = await this.client.findOrCreateUser({ id:user.id });
|
||||
const oldLover = await this.client.findOrCreateUser({
|
||||
id: user.id
|
||||
});
|
||||
oldLover.lover = null;
|
||||
oldLover.save();
|
||||
|
||||
// Send success message
|
||||
message.success("economy/divorce:DIVORCED", { username: user.username });
|
||||
message.success("economy/divorce:DIVORCED", {
|
||||
username: user.username
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,48 +2,52 @@ const Command = require("../../base/Command.js"),
|
|||
AsciiTable = require("ascii-table");
|
||||
|
||||
class Leaderboard extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "leaderboard",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "lb" ],
|
||||
aliases: ["lb"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
const isOnlyOnMobile = (message.author.presence.clientStatus ? JSON.stringify(Object.keys(message.author.presence.clientStatus)) === JSON.stringify([ "mobile" ]) : false);
|
||||
async run(message, args) {
|
||||
const isOnlyOnMobile = (message.author.presence.clientStatus ? JSON.stringify(Object.keys(message.author.presence.clientStatus)) === JSON.stringify(["mobile"]) : false);
|
||||
|
||||
const type = args[0];
|
||||
if (!type || (type !== "credits" && type !== "level" && type !== "rep")) return message.error("economy/leaderboard:MISSING_TYPE");
|
||||
|
||||
if (type === "credits") {
|
||||
const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(),
|
||||
const members = await this.client.membersData.find({
|
||||
guildID: message.guild.id
|
||||
}).lean(),
|
||||
membersLeaderboard = members.map((m) => {
|
||||
return {
|
||||
id: m.id,
|
||||
value: m.money + m.bankSold
|
||||
};
|
||||
}).sort((a,b) => b.value - a.value);
|
||||
}).sort((a, b) => b.value - a.value);
|
||||
const table = new AsciiTable("Таблица лидеров");
|
||||
table.setHeading("#", message.translate("common:USER"), message.translate("common:CREDITS"));
|
||||
if (membersLeaderboard.length > 20) membersLeaderboard.length = 20;
|
||||
const newTable = await fetchUsers(membersLeaderboard, table, this.client);
|
||||
message.channel.send(`\`\`\`\n${newTable.toString()}\`\`\``);
|
||||
} else if (type === "level") {
|
||||
const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(),
|
||||
const members = await this.client.membersData.find({
|
||||
guildID: message.guild.id
|
||||
}).lean(),
|
||||
membersLeaderboard = members.map((m) => {
|
||||
return {
|
||||
id: m.id,
|
||||
value: m.level
|
||||
};
|
||||
}).sort((a,b) => b.value - a.value);
|
||||
}).sort((a, b) => b.value - a.value);
|
||||
const table = new AsciiTable("Таблица лидеров");
|
||||
table.setHeading("#", message.translate("common:USER"), message.translate("common:LEVEL"));
|
||||
if (membersLeaderboard.length > 20) membersLeaderboard.length = 20;
|
||||
|
@ -56,7 +60,7 @@ class Leaderboard extends Command {
|
|||
id: u.id,
|
||||
value: u.rep
|
||||
};
|
||||
}).sort((a,b) => b.value - a.value);
|
||||
}).sort((a, b) => b.value - a.value);
|
||||
const table = new AsciiTable("Таблица лидеров");
|
||||
table.setHeading("#", message.translate("common:USER"), message.translate("common:POINTS"));
|
||||
if (usersLeaderboard.length > 20) usersLeaderboard.length = 20;
|
||||
|
|
|
@ -1,37 +1,42 @@
|
|||
const Command = require("../../base/Command.js"),
|
||||
Discord = require("discord.js");
|
||||
|
||||
// An object to store pending requests
|
||||
const pendings = {};
|
||||
|
||||
class Marry extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "marry",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "mariage" ],
|
||||
aliases: ["mariage"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
// if the message author is already wedded
|
||||
if (data.userData.lover) return message.error("economy/marry:ALREADY_MARRIED", { prefix: data.guild.prefix });
|
||||
if (data.userData.lover) return message.error("economy/marry:ALREADY_MARRIED", {
|
||||
prefix: data.guild.prefix
|
||||
});
|
||||
|
||||
// Gets the first mentionned member
|
||||
const member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) return message.error("economy/marry:INVALID_MEMBER");
|
||||
|
||||
const userData = await this.client.findOrCreateUser({ id: member.id });
|
||||
const userData = await this.client.findOrCreateUser({
|
||||
id: member.id
|
||||
});
|
||||
|
||||
// if the member is already wedded
|
||||
if (userData.lover) return message.error("economy/marry:ALREADY_MARRIED_USER", { username: member.user.tag });
|
||||
if (userData.lover) return message.error("economy/marry:ALREADY_MARRIED_USER", {
|
||||
username: member.user.tag
|
||||
});
|
||||
|
||||
if (member.user.bot) return message.error("economy/marry:BOT_USER");
|
||||
|
||||
|
@ -42,23 +47,36 @@ class Marry extends Command {
|
|||
// If the member already sent a request to someone
|
||||
if (requester === message.author.id) {
|
||||
const user = this.client.users.cache.get(receiver) || await this.client.users.fetch(receiver);
|
||||
return message.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", { username: user.tag });
|
||||
return message.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", {
|
||||
username: user.tag
|
||||
});
|
||||
} else if (receiver === message.author.id) { // If there is a pending request for this member
|
||||
const user = this.client.users.cache.get(requester) || await this.client.users.fetch(requester);
|
||||
return message.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", { username: user.tag });
|
||||
return message.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", {
|
||||
username: user.tag
|
||||
});
|
||||
} else if (requester === member.id) { // If the asked member has sent pending request
|
||||
const user = this.client.users.cache.get(receiver) || await this.client.users.fetch(receiver);
|
||||
return message.error("economy/marry:REQUEST_AMEMBER_TO_MEMBER", { firstUsername: member.user.tag, secondUsername: user.tag });
|
||||
return message.error("economy/marry:REQUEST_AMEMBER_TO_MEMBER", {
|
||||
firstUsername: member.user.tag,
|
||||
secondUsername: user.tag
|
||||
});
|
||||
} else if (receiver === member.id) { // If there is a pending request for the asked member
|
||||
const user = this.client.users.cache.get(requester) || await this.client.users.fetch(requester);
|
||||
return message.error("economy/marry:REQUEST_MEMBER_TO_AMEMBER", { firstUsername: member.user.tag, secondUsername: user.tag });
|
||||
return message.error("economy/marry:REQUEST_MEMBER_TO_AMEMBER", {
|
||||
firstUsername: member.user.tag,
|
||||
secondUsername: user.tag
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// Update pending requests
|
||||
pendings[message.author.id] = member.id;
|
||||
|
||||
message.sendT("economy/marry:REQUEST", { from: message.author.toString(), to: member.user.toString() });
|
||||
message.sendT("economy/marry:REQUEST", {
|
||||
from: message.author.toString(),
|
||||
to: member.user.toString()
|
||||
});
|
||||
|
||||
const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === member.id, {
|
||||
time: 120000
|
||||
|
@ -78,7 +96,9 @@ class Marry extends Command {
|
|||
// Delete pending request
|
||||
delete pendings[message.author.id];
|
||||
if (reason === "time") {
|
||||
return message.error("economy/marry:TIMEOUT", { username: member.user.toString() });
|
||||
return message.error("economy/marry:TIMEOUT", {
|
||||
username: member.user.toString()
|
||||
});
|
||||
};
|
||||
if (reason) {
|
||||
data.userData.lover = member.id;
|
||||
|
@ -87,12 +107,10 @@ class Marry extends Command {
|
|||
await userData.save();
|
||||
const messageOptions = {
|
||||
content: `${member.toString()} :heart: ${message.author.toString()}`,
|
||||
files: [
|
||||
{
|
||||
files: [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked3.png"
|
||||
}
|
||||
]
|
||||
}]
|
||||
};
|
||||
let sent = false;
|
||||
if (!userData.achievements.married.achieved) {
|
||||
|
@ -110,9 +128,15 @@ class Marry extends Command {
|
|||
data.userData.markModified("achievements.married");
|
||||
data.userData.save();
|
||||
};
|
||||
return message.success("economy/marry:SUCCESS", { creator: message.author.toString(), partner: member.user.toString() });
|
||||
return message.success("economy/marry:SUCCESS", {
|
||||
creator: message.author.toString(),
|
||||
partner: member.user.toString()
|
||||
});
|
||||
} else {
|
||||
return message.success("economy/marry:DENIED", { creator: message.author.toString(), partner: member.user.toString() });
|
||||
return message.success("economy/marry:DENIED", {
|
||||
creator: message.author.toString(),
|
||||
partner: member.user.toString()
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,42 +8,52 @@ const asyncForEach = async (array, callback) => {
|
|||
};
|
||||
|
||||
class Credits extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "money",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "credits", "balance" ],
|
||||
aliases: ["credits", "balance"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) member = message.member;
|
||||
const user = member.user;
|
||||
|
||||
if (user.bot) return message.error("misc:BOT_USER");
|
||||
|
||||
const memberData = (message.author === user) ? data.memberData : await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id });
|
||||
const memberData = (message.author === user) ? data.memberData : await this.client.findOrCreateMember({
|
||||
id: user.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
|
||||
const commonsGuilds = this.client.guilds.cache.filter((g) => g.members.cache.get(user.id));
|
||||
let globalMoney = 0;
|
||||
await asyncForEach(commonsGuilds.array(), async (guild) => {
|
||||
const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: guild.id });
|
||||
globalMoney+=memberData.money;
|
||||
globalMoney+=memberData.bankSold;
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: user.id,
|
||||
guildID: guild.id
|
||||
});
|
||||
globalMoney += memberData.money;
|
||||
globalMoney += memberData.bankSold;
|
||||
});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("economy/money:TITLE", {
|
||||
username: member.user.username
|
||||
}), member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
}), member.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.addField(message.translate("economy/profile:CASH"), message.translate("economy/profile:MONEY", {
|
||||
money: memberData.money
|
||||
}), true)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Pay extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "pay",
|
||||
dirname: __dirname,
|
||||
|
@ -9,29 +9,29 @@ class Pay extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) return message.error("economy/pay:INVALID_MEMBER");
|
||||
|
||||
if (member.user.bot) return message.error("economy/pay:BOT_USER");
|
||||
|
||||
if (member.id === message.author.id) return message.error("economy/pay:YOURSELF");
|
||||
|
||||
const sentAmount = args[1];
|
||||
if (!sentAmount || isNaN(sentAmount) || parseInt(sentAmount, 10) <= 0) return message.error("economy/pay:INVALID_AMOUNT", { username: member.user.tag });
|
||||
|
||||
const amount = Math.ceil(parseInt(sentAmount, 10));
|
||||
|
||||
if (amount > data.memberData.money) return message.error("economy/pay:ENOUGH_MONEY", { amount, username: member.user.tag });
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
|
||||
data.memberData.money = data.memberData.money - parseInt(amount, 10);
|
||||
data.memberData.save();
|
||||
|
@ -39,8 +39,10 @@ class Pay extends Command {
|
|||
memberData.money = memberData.money + parseInt(amount, 10);
|
||||
memberData.save();
|
||||
|
||||
// Send a success message
|
||||
message.success("economy/pay:SUCCESS", { amount, username: member.user.tag });
|
||||
message.success("economy/pay:SUCCESS", {
|
||||
amount,
|
||||
username: member.user.tag
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -8,42 +8,45 @@ const asyncForEach = async (array, callback) => {
|
|||
};
|
||||
|
||||
class Profile extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "profile",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "profil" ],
|
||||
aliases: ["profil"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const client = this.client;
|
||||
|
||||
const arg = args[0] || message.author
|
||||
let member = await client.resolveMember(arg, message.guild);
|
||||
if (!member) member = message.member;
|
||||
|
||||
// Check if the user is a bot
|
||||
if (member.user.bot) return message.error("economy/profile:BOT_USER");
|
||||
|
||||
// Gets the data of the user whose profile you want to display
|
||||
const memberData = (member.id === message.author.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildID: message.guild.id}));
|
||||
const userData = (member.id === message.author.id ? data.userData : await client.findOrCreateUser({ id: member.id }));
|
||||
|
||||
// Check if the lover is cached
|
||||
const memberData = (member.id === message.author.id ? data.memberData : await client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: message.guild.id
|
||||
}));
|
||||
const userData = (member.id === message.author.id ? data.userData : await client.findOrCreateUser({
|
||||
id: member.id
|
||||
}));
|
||||
if (userData.lover && !this.client.users.cache.get(userData.lover)) await this.client.users.fetch(userData.lover, true);
|
||||
|
||||
const commonsGuilds = client.guilds.cache.filter((g) => g.members.cache.get(member.id));
|
||||
let globalMoney = 0;
|
||||
await asyncForEach(commonsGuilds.array(), async (guild) => {
|
||||
const memberData = await client.findOrCreateMember({ id: member.id, guildID: guild.id });
|
||||
const memberData = await client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: guild.id
|
||||
});
|
||||
globalMoney += memberData.money;
|
||||
globalMoney += memberData.bankSold;
|
||||
});
|
||||
|
@ -51,8 +54,15 @@ class Profile extends Command {
|
|||
const profileEmbed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("economy/profile:TITLE", {
|
||||
username: member.user.tag
|
||||
}), member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.attachFiles([{ attachment: await userData.getAchievements(), name: "achievements.png" }])
|
||||
}), member.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.attachFiles([{
|
||||
attachment: await userData.getAchievements(),
|
||||
name: "achievements.png"
|
||||
}])
|
||||
.setImage("attachment://achievements.png")
|
||||
// .setDescription(userData.bio ? userData.bio : message.translate("economy/profile:NO_BIO"))
|
||||
.addField(message.translate("economy/profile:BIO"), userData.bio ? userData.bio : message.translate("economy/profile:NO_BIO"))
|
||||
|
@ -71,7 +81,7 @@ class Profile extends Command {
|
|||
.addField(message.translate("economy/profile:LEVEL"), `**${memberData.level}**`, true)
|
||||
.addField(message.translate("economy/profile:EXP"), `**${memberData.exp}/${5 * (memberData.level * memberData.level) + 80 * memberData.level + 100}** xp`, true)
|
||||
.addField(message.translate("economy/profile:REGISTERED"), message.printDate(new Date(memberData.registeredAt)), true)
|
||||
.addField(message.translate("economy/profile:BIRTHDATE"), (!userData.birthdate ? message.translate("economy/profile:NO_BIRTHDATE"): message.printDate(new Date(userData.birthdate))), true)
|
||||
.addField(message.translate("economy/profile:BIRTHDATE"), (!userData.birthdate ? message.translate("economy/profile:NO_BIRTHDATE") : message.printDate(new Date(userData.birthdate))), true)
|
||||
.addField(message.translate("economy/profile:LOVER"), (!userData.lover ? message.translate("economy/profile:NO_LOVER") : this.client.users.cache.get(userData.lover).tag), true)
|
||||
.addField(message.translate("economy/profile:ACHIEVEMENTS"), message.translate("economy/profile:ACHIEVEMENTS_CONTENT", {
|
||||
prefix: data.guild.prefix
|
||||
|
|
|
@ -1,29 +1,33 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Rep extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "rep",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "reputation" ],
|
||||
aliases: ["reputation"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
// if the member is already in the cooldown db
|
||||
const isInCooldown = (data.userData.cooldowns || { rep: 0 }).rep;
|
||||
const isInCooldown = (data.userData.cooldowns || {
|
||||
rep: 0
|
||||
}).rep;
|
||||
if (isInCooldown) {
|
||||
/*if the timestamp recorded in the database indicating
|
||||
when the member will be able to execute the order again
|
||||
is greater than the current date, display an error message */
|
||||
if (isInCooldown > Date.now()) return message.error("economy/rep:COOLDOWN", { time: message.convertTime(isInCooldown, "to", true) });
|
||||
if (isInCooldown > Date.now()) return message.error("economy/rep:COOLDOWN", {
|
||||
time: message.convertTime(isInCooldown, "to", true)
|
||||
});
|
||||
};
|
||||
|
||||
const user = await this.client.resolveUser(args[0]);
|
||||
|
@ -38,19 +42,28 @@ class Rep extends Command {
|
|||
data.userData.markModified("cooldowns");
|
||||
data.userData.save();
|
||||
|
||||
const userData = await this.client.findOrCreateUser({ id: user.id });
|
||||
const userData = await this.client.findOrCreateUser({
|
||||
id: user.id
|
||||
});
|
||||
userData.rep++;
|
||||
if (!userData.achievements.rep.achieved) {
|
||||
userData.achievements.rep.progress.now = (userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep);
|
||||
if (userData.achievements.rep.progress.now >= userData.achievements.rep.progress.total) {
|
||||
userData.achievements.rep.achieved = true;
|
||||
message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked6.png"}]});
|
||||
message.channel.send({
|
||||
files: [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked6.png"
|
||||
}]
|
||||
});
|
||||
};
|
||||
userData.markModified("achievements.rep");
|
||||
};
|
||||
await userData.save();
|
||||
|
||||
message.success("economy/rep:SUCCESS", { username: user.username });
|
||||
message.success("economy/rep:SUCCESS", {
|
||||
username: user.username
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,42 +1,55 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Rob extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "rob",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "steal" ],
|
||||
aliases: ["steal"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) return message.error("economy/rob:MISSING_MEMBER");
|
||||
|
||||
if (member.id === message.author.id) return message.error("economy/rob:YOURSELF");
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
const isInCooldown = memberData.cooldowns.rob || 0;
|
||||
if (isInCooldown) {
|
||||
if (isInCooldown > Date.now()) return message.error("economy/rob:COOLDOWN", { username: member.user.tag });
|
||||
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 });
|
||||
if (!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0) return message.error("economy/rob:MISSING_AMOUNT", {
|
||||
username: member.user.username
|
||||
});
|
||||
|
||||
amountToRob = Math.floor(parseInt(amountToRob, 10));
|
||||
|
||||
if (amountToRob > memberData.money) return message.error("economy/rob:NOT_ENOUGH_MEMBER", { username: member.user.username, money: amountToRob });
|
||||
if (amountToRob > memberData.money) return message.error("economy/rob:NOT_ENOUGH_MEMBER", {
|
||||
username: member.user.username,
|
||||
money: amountToRob
|
||||
});
|
||||
|
||||
const potentiallyLose = Math.floor(amountToRob * 1.5);
|
||||
if (potentiallyLose > data.memberData.money) return message.error("economy/rob:NOT_ENOUGH_AUTHOR", { moneyMin: potentiallyLose, moneyCurrent: data.memberData.money });
|
||||
if (potentiallyLose > data.memberData.money) return message.error("economy/rob:NOT_ENOUGH_AUTHOR", {
|
||||
moneyMin: potentiallyLose,
|
||||
moneyCurrent: data.memberData.money
|
||||
});
|
||||
|
||||
const itsAWon = Math.floor(this.client.functions.randomNum(0, 100) < 25);
|
||||
|
||||
|
@ -46,7 +59,10 @@ class Rob extends Command {
|
|||
memberData.markModified("cooldowns");
|
||||
await memberData.save();
|
||||
const randomNum = Math.floor(this.client.functions.randomNum(1, 3));
|
||||
message.sendT("economy/rob:ROB_WON_" + randomNum, { money: amountToRob, username: member.user.username });
|
||||
message.sendT("economy/rob:ROB_WON_" + randomNum, {
|
||||
money: amountToRob,
|
||||
username: member.user.username
|
||||
});
|
||||
data.memberData.money += amountToRob;
|
||||
memberData.money -= amountToRob, 10;
|
||||
memberData.save();
|
||||
|
@ -54,7 +70,11 @@ class Rob extends Command {
|
|||
} else {
|
||||
const won = Math.floor(0.9 * amountToRob);
|
||||
const randomNum = Math.floor(this.client.functions.randomNum(1, 3));
|
||||
message.sendT("economy/rob:ROB_LOSE_" + randomNum, { fine: potentiallyLose, offset: won, username: member.user.username });
|
||||
message.sendT("economy/rob:ROB_LOSE_" + randomNum, {
|
||||
fine: potentiallyLose,
|
||||
offset: won,
|
||||
username: member.user.username
|
||||
});
|
||||
data.memberData.money -= potentiallyLose;
|
||||
memberData.money += won;
|
||||
memberData.save();
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Setbio extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setbio",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "biography", "setdesc" ],
|
||||
aliases: ["biography", "setdesc"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const newBio = args.join(" ");
|
||||
if (!newBio) return message.error("economy/setbio:MISSING");
|
||||
if (newBio.length > 100) return message.error("economy/setbio:MAX_CHARACT");
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Slots extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "slots",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "casino", "slot" ],
|
||||
aliases: ["casino", "slot"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
const fruits = [ "🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓" ];
|
||||
async run(message, args, data) {
|
||||
const fruits = ["🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓"];
|
||||
|
||||
let i1=0, j1=0, k1=0,
|
||||
i2=1, j2=1, k2=1,
|
||||
i3=2, j3=2, k3=2;
|
||||
let i1 = 0, j1 = 0, k1 = 0,
|
||||
i2 = 1, j2 = 1, k2 = 1,
|
||||
i3 = 2, j3 = 2, k3 = 2;
|
||||
|
||||
// Gets three random fruits array
|
||||
const colonnes = [
|
||||
|
@ -33,7 +33,6 @@ class Slots extends Command {
|
|||
// Gets the amount provided
|
||||
let amount = args[0];
|
||||
if (!amount || isNaN(amount) || amount < 1) amount = 1;
|
||||
|
||||
if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", { money: amount });
|
||||
|
||||
amount = Math.round(amount);
|
||||
|
@ -47,7 +46,9 @@ class Slots extends Command {
|
|||
return Math.round(number);
|
||||
};
|
||||
|
||||
const tmsg = await message.sendT("misc:loading", null, { prefixEmoji: "loading" });
|
||||
const tmsg = await message.sendT("misc:loading", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
editMsg();
|
||||
const interval = setInterval(editMsg, 1000);
|
||||
setTimeout(() => {
|
||||
|
@ -76,14 +77,23 @@ class Slots extends Command {
|
|||
msg += "| : : : **" + (message.translate("common:VICTORY").toUpperCase()) + "** : : : |";
|
||||
tmsg.edit(msg);
|
||||
const credits = getCredits(amount, true);
|
||||
message.channel.send("**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", { money: amount, won: credits, username: message.author.username }));
|
||||
message.channel.send("**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", {
|
||||
money: amount,
|
||||
won: credits,
|
||||
username: message.author.username
|
||||
}));
|
||||
const toAdd = credits - amount;
|
||||
data.memberData.money = data.memberData.money + toAdd;
|
||||
if (!data.userData.achievements.slots.achieved) {
|
||||
data.userData.achievements.slots.progress.now += 1;
|
||||
if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) {
|
||||
data.userData.achievements.slots.achieved = true;
|
||||
message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] });
|
||||
message.channel.send({
|
||||
files: [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png"
|
||||
}]
|
||||
});
|
||||
};
|
||||
data.userData.markModified("achievements.slots");
|
||||
await data.userData.save();
|
||||
|
@ -107,7 +117,12 @@ class Slots extends Command {
|
|||
data.userData.achievements.slots.progress.now += 1;
|
||||
if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) {
|
||||
data.userData.achievements.slots.achieved = true;
|
||||
message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] });
|
||||
message.channel.send({
|
||||
files: [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png"
|
||||
}]
|
||||
});
|
||||
};
|
||||
data.userData.markModified("achievements.slots");
|
||||
await data.userData.save();
|
||||
|
@ -144,9 +159,9 @@ class Slots extends Command {
|
|||
k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0;
|
||||
k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0;
|
||||
|
||||
msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : "+ colonnes[2][k1] + "\n";
|
||||
msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : "+ colonnes[2][k2] + " **<**\n";
|
||||
msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : "+ colonnes[2][k3] + "\n";
|
||||
msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n";
|
||||
msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n";
|
||||
msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n";
|
||||
|
||||
tmsg.edit(msg);
|
||||
};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Withdraw extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "withdraw",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "wd" ],
|
||||
aliases: ["wd"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let amount = args[0];
|
||||
|
||||
if (!(parseInt(data.memberData.bankSold, 10) > 0)) return message.error("economy/withdraw:NO_CREDIT");
|
||||
|
@ -25,7 +25,7 @@ class Withdraw extends Command {
|
|||
if (args[0] === "all") {
|
||||
amount = parseInt(data.memberData.bankSold, 10);
|
||||
} else {
|
||||
if (isNaN(amount) || parseInt(amount, 10) < 1)return message.error("economy/withdraw:MISSING_AMOUNT");
|
||||
if (isNaN(amount) || parseInt(amount, 10) < 1) return message.error("economy/withdraw:MISSING_AMOUNT");
|
||||
amount = parseInt(amount, 10);
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,9 @@ class Withdraw extends Command {
|
|||
data.memberData.bankSold = data.memberData.bankSold - amount;
|
||||
data.memberData.save();
|
||||
|
||||
message.success("economy/withdraw:SUCCESS", { money: amount });
|
||||
message.success("economy/withdraw:SUCCESS", {
|
||||
money: amount
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,29 +2,31 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Work extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "work",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "salaire", "salary", "travail", "daily", "dailies" ],
|
||||
aliases: ["salaire", "salary", "travail", "daily", "dailies"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
// if the member is already in the cooldown db
|
||||
const isInCooldown = data.memberData.cooldowns.work;
|
||||
if (isInCooldown) {
|
||||
/*if the timestamp recorded in the database indicating
|
||||
when the member will be able to execute the order again
|
||||
is greater than the current date, display an error message */
|
||||
if (isInCooldown > Date.now()) return message.error("economy/work:COOLDOWN", { time: message.convertTime(isInCooldown, "to", true) });
|
||||
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;
|
||||
|
@ -38,7 +40,11 @@ class Work extends Command {
|
|||
await data.memberData.save();
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setFooter(message.translate("economy/work:AWARD"), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setFooter(message.translate("economy/work:AWARD"), message.author.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setColor(data.config.embed.color);
|
||||
|
||||
const award = [
|
||||
|
@ -52,7 +58,9 @@ 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 }))
|
||||
embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", {
|
||||
won
|
||||
}))
|
||||
.addField(message.translate("economy/work:STREAK"), message.translate("economy/work:STREAK_CONTENT"));
|
||||
data.memberData.workStreak = 0;
|
||||
} else {
|
||||
|
@ -62,23 +70,25 @@ class Work extends Command {
|
|||
award[i] = `:regional_indicator_${letter.toLowerCase()}:`;
|
||||
};
|
||||
};
|
||||
embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", { won }))
|
||||
embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", {
|
||||
won
|
||||
}))
|
||||
.addField(message.translate("economy/work:STREAK"), award.join(""));
|
||||
};
|
||||
|
||||
data.memberData.money = data.memberData.money + won;
|
||||
data.memberData.save();
|
||||
|
||||
const messageOptions = { embed };
|
||||
const messageOptions = {
|
||||
embed
|
||||
};
|
||||
if (!data.userData.achievements.work.achieved) {
|
||||
data.userData.achievements.work.progress.now += 1;
|
||||
if (data.userData.achievements.work.progress.now === data.userData.achievements.work.progress.total) {
|
||||
messageOptions.files = [
|
||||
{
|
||||
messageOptions.files = [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked1.png"
|
||||
}
|
||||
];
|
||||
}];
|
||||
data.userData.achievements.work.achieved = true;
|
||||
};
|
||||
data.userData.markModified("achievements.work");
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Eightball extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "8ball",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "eight-ball", "eightball" ],
|
||||
aliases: ["eight-ball", "eightball"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
if (!args[0] || !message.content.endsWith("?")) return message.error("fun/8ball:ERR_QUESTION");
|
||||
|
||||
const answerNO = parseInt(Math.floor(Math.random() * 10), 10);
|
||||
|
|
|
@ -4,7 +4,7 @@ const Command = require("../../base/Command.js"),
|
|||
figletAsync = util.promisify(figlet);
|
||||
|
||||
class Ascii extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "ascii",
|
||||
dirname: __dirname,
|
||||
|
@ -12,18 +12,20 @@ class Ascii extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const text = args.join(" ");
|
||||
if (!text || text.length > 20) return message.error("fun/ascii:TEXT_MISSING");
|
||||
|
||||
const rendered = await figletAsync(text);
|
||||
if (!rendered) rendered = await figletAsync("Nothing");
|
||||
|
||||
message.channel.send("```" + rendered + "```");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Choice extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "choice",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "random" ],
|
||||
aliases: ["random"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
// Gets the answers by spliting on "/"
|
||||
const answers = args.join(" ").split("/");
|
||||
if (answers.length < 2) return message.error("fun/choice:MISSING");
|
||||
|
@ -25,7 +25,9 @@ class Choice extends Command {
|
|||
const m = await message.sendT("fun/choice:PROGRESS", null, false, false, "loading");
|
||||
|
||||
setTimeout(() => {
|
||||
m.success("fun/choice:DONE", null, { edit: true });
|
||||
m.success("fun/choice:DONE", null, {
|
||||
edit: true
|
||||
});
|
||||
const result = answers[parseInt(Math.floor(Math.random() * answers.length))];
|
||||
message.channel.send("```" + result + "```");
|
||||
}, 1500);
|
||||
|
|
|
@ -4,7 +4,7 @@ const Command = require("../../base/Command.js"),
|
|||
const currentGames = {};
|
||||
|
||||
class FindWords extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "findwords",
|
||||
dirname: __dirname,
|
||||
|
@ -12,14 +12,14 @@ class FindWords extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (currentGames[message.guild.id]) return message.error("fun/number:GAME_RUNNING");
|
||||
|
||||
// Reads words file
|
||||
|
@ -55,7 +55,9 @@ class FindWords extends Command {
|
|||
|
||||
setTimeout(() => {
|
||||
// Send announcment message
|
||||
message.sendT("fun/findwords:FIND_WORD", { word }, false, false, "warn");
|
||||
message.sendT("fun/findwords:FIND_WORD", {
|
||||
word
|
||||
}, false, false, "warn");
|
||||
|
||||
// init a collector to receive the answers
|
||||
const collector = new Discord.MessageCollector(message.channel, (m) => !m.author.bot, {
|
||||
|
@ -69,7 +71,9 @@ class FindWords extends Command {
|
|||
if (msg.content.toLowerCase().indexOf(word) >= 0 && wordList.map((word) => word.toLowerCase()).indexOf(msg.content.toLowerCase()) >= 0) {
|
||||
collector.stop(msg.author.id); // Stop the collector
|
||||
} else {
|
||||
msg.error("fun/findwords:INVALID_WORD", { member: msg.author.toString() });
|
||||
msg.error("fun/findwords:INVALID_WORD", {
|
||||
member: msg.author.toString()
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -77,7 +81,9 @@ class FindWords extends Command {
|
|||
if (reason === "time") {
|
||||
message.error("fun/findwords:NO_WINNER");
|
||||
} else {
|
||||
message.success("fun/findwords:WORD_FOUND", { winner: `<@${reason}>` });
|
||||
message.success("fun/findwords:WORD_FOUND", {
|
||||
winner: `<@${reason}>`
|
||||
});
|
||||
winners.push(reason);
|
||||
}
|
||||
if (i < nbGames - 1) {
|
||||
|
@ -97,8 +103,13 @@ class FindWords extends Command {
|
|||
participantList: participants.map((p) => `<@${p}>`).join("\n")
|
||||
});
|
||||
if (participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes("Economy")) {
|
||||
message.sendT("fun/findwords:CREDITS", { winner: user.username });
|
||||
const userdata = await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id });
|
||||
message.sendT("fun/findwords:CREDITS", {
|
||||
winner: user.username
|
||||
});
|
||||
const userdata = await this.client.findOrCreateMember({
|
||||
id: user.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
userdata.money = userdata.money + 15;
|
||||
userdata.save();
|
||||
};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Flip extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "flip",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "dice", "coin" ],
|
||||
aliases: ["dice", "coin"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message) {
|
||||
async run(message) {
|
||||
const isHeads = Math.random() > 0.5;
|
||||
isHeads ? message.sendT("fun/flip:HEADS") : message.sendT("fun/flip:TAILS");
|
||||
}
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Fml extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "fml",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "vdm" ],
|
||||
aliases: ["vdm"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (!this.client.config.apiKeys.blagueXYZ) return message.error("misc:COMMAND_DISABLED");
|
||||
|
||||
// const fml = await this.client.joker.randomVDM(null, data.guild.language.substr(0, 2));
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Joke extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "joke",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "blague" ],
|
||||
aliases: ["blague"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (!this.client.config.apiKeys.blagueXYZ) return message.error("misc:COMMAND_DISABLED");
|
||||
|
||||
// const joke = await this.client.joker.randomJoke(data.guild.language.substr(0, 2));
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Lmg extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "lmg",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "lmgtfy" ],
|
||||
aliases: ["lmgtfy"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const question = args.join(" ");
|
||||
if (!question) return message.error("fun/lmg:MISSING");
|
||||
const encodedQuestion = question.replace(/[' '_]/g, "+");
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
md5 = require("md5");
|
||||
|
||||
class Lovecalc extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "lovecalc",
|
||||
dirname: __dirname,
|
||||
|
@ -11,14 +11,14 @@ class Lovecalc extends Command {
|
|||
guildOnly: true,
|
||||
aliases: ["lc"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message) {
|
||||
async run(message) {
|
||||
const firstMember = message.mentions.members.filter(m => m.id !== message.author.id).first();
|
||||
if (!firstMember) return message.error("fun/lovecalc:MISSING");
|
||||
const secondMember = message.mentions.members
|
||||
|
@ -37,8 +37,12 @@ class Lovecalc extends Command {
|
|||
const percent = parseInt(string.substr(0, 2), 10);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor("❤️ LoveCalc")
|
||||
.setDescription(message.translate("fun/lovecalc:CONTENT", { percent, firstUsername: firstMember.user.username, secondUsername: secondMember.user.username }))
|
||||
.setAuthor(`❤️ ${message.translate("fun/lovecalc:DESCRIPTION")}`)
|
||||
.setDescription(message.translate("fun/lovecalc:CONTENT", {
|
||||
percent,
|
||||
firstUsername: firstMember.user.username,
|
||||
secondUsername: secondMember.user.username
|
||||
}))
|
||||
.setColor(this.client.config.embed.color)
|
||||
.setFooter(this.client.config.embed.footer);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const Command = require("../../base/Command.js"),
|
|||
const currentGames = {};
|
||||
|
||||
class Number extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "number",
|
||||
dirname: __dirname,
|
||||
|
@ -12,14 +12,14 @@ class Number extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message) {
|
||||
async run(message) {
|
||||
if (currentGames[message.guild.id]) return message.error("fun/number:GAME_RUNNING");
|
||||
|
||||
const participants = [];
|
||||
|
@ -38,28 +38,46 @@ class Number extends Command {
|
|||
collector.on("collect", async msg => {
|
||||
if (!participants.includes(msg.author.id)) participants.push(msg.author.id);
|
||||
|
||||
// if it's not a number, return
|
||||
if (isNaN(msg.content)) return;
|
||||
|
||||
const parsedNumber = parseInt(msg.content, 10);
|
||||
|
||||
if (parsedNumber === number) {
|
||||
const time = this.client.functions.convertTime(message.guild, Date.now() - gameCreatedAt);
|
||||
message.sendT("fun/number:GAME_STATS", { winner: msg.author.toString(), number, time, participantCount: participants.length, participants: participants.map(p => `<@${p}>`).join("\n") });
|
||||
message.sendT("fun/number:WON", { winner: msg.author.toString() });
|
||||
const userdata = await this.client.findOrCreateMember({ id: msg.author.id, guildID: message.guild.id });
|
||||
message.sendT("fun/number:GAME_STATS", {
|
||||
winner: msg.author.toString(),
|
||||
number,
|
||||
time,
|
||||
participantCount: participants.length,
|
||||
participants: participants.map(p => `<@${p}>`).join("\n")
|
||||
});
|
||||
message.sendT("fun/number:WON", {
|
||||
winner: msg.author.toString()
|
||||
});
|
||||
const userdata = await this.client.findOrCreateMember({
|
||||
id: msg.author.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
userdata.money = userdata.money + 10;
|
||||
userdata.save();
|
||||
collector.stop(msg.author.username);
|
||||
};
|
||||
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 });
|
||||
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 });
|
||||
return message.error("fun/number:DEFEAT", {
|
||||
number
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Activity extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "activity",
|
||||
dirname: __dirname,
|
||||
|
@ -10,14 +10,14 @@ class Activity extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const voice = message.member.voice.channel;
|
||||
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
||||
|
||||
|
|
|
@ -3,22 +3,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Fortnite extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "fortnite",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "fn" ],
|
||||
aliases: ["fn"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (!data.config.apiKeys.fortniteTRN || data.config.apiKeys.fortniteTRN.length === "") return message.success("misc:COMMAND_DISABLED");
|
||||
|
||||
const stats = new Canvas.FortniteStats();
|
||||
|
@ -29,7 +29,9 @@ class Fortnite extends Command {
|
|||
const user = args.slice(1).join(" ");
|
||||
if (!user) return message.error("general/fortnite:MISSING_USERNAME");
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
const statsImage = await stats
|
||||
.setToken(data.config.apiKeys.fortniteTRN)
|
||||
|
@ -51,13 +53,18 @@ class Fortnite extends Command {
|
|||
|
||||
if (!statsImage) {
|
||||
m.delete();
|
||||
return message.error("general/fortnite:NOT_FOUND", { platform, search: user });
|
||||
return message.error("general/fortnite:NOT_FOUND", {
|
||||
platform,
|
||||
search: user
|
||||
});
|
||||
};
|
||||
|
||||
// Send embed
|
||||
const attachment = new Discord.MessageAttachment(statsImage.toBuffer(), "fortnite-stats-image.png"),
|
||||
embed = new Discord.MessageEmbed()
|
||||
.setDescription(message.translate("general/fortnite:TITLE", { username: `[${stats.data.username}](${stats.data.url.replace(new RegExp(" ", "g"), "%20")})` }))
|
||||
.setDescription(message.translate("general/fortnite:TITLE", {
|
||||
username: `[${stats.data.username}](${stats.data.url.replace(new RegExp(" ", "g"), "%20")})`
|
||||
}))
|
||||
.attachFiles(attachment)
|
||||
.setImage("attachment://fortnite-stats-image.png")
|
||||
.setColor(data.config.embed.color)
|
||||
|
|
|
@ -3,15 +3,15 @@ const Command = require("../../base/Command.js"),
|
|||
Canvas = require("discord-canvas");
|
||||
|
||||
class Fortniteshop extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "fortniteshop",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "fnshop" ],
|
||||
aliases: ["fnshop"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
|
@ -21,7 +21,9 @@ class Fortniteshop extends Command {
|
|||
async run(message, args, data) {
|
||||
if (!data.config.apiKeys.fortniteFNBR || data.config.apiKeys.fortniteFNBR.length === "") return message.error("misc:COMMAND_DISABLED");
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
const momentName = this.client.languages.find((language) => language.name === data.guild.language || language.aliases.includes(data.guild.language)).moment;
|
||||
const shop = new Canvas.FortniteShop();
|
||||
|
@ -30,14 +32,22 @@ class Fortniteshop extends Command {
|
|||
.setText("header", message.translate("general/fortniteshop:HEADER"))
|
||||
.setText("daily", message.translate("general/fortniteshop:DAILY"))
|
||||
.setText("featured", message.translate("general/fortniteshop:FEATURED"))
|
||||
.setText("date", message.translate("general/fortniteshop:DATE", { skipInterpolation: true }).replace("{{date}}", "{date}"))
|
||||
.setText("date", message.translate("general/fortniteshop:DATE", {
|
||||
skipInterpolation: true
|
||||
}).replace("{{date}}", "{date}"))
|
||||
.setText("footer", message.translate("general/fortniteshop:FOOTER"))
|
||||
.lang(momentName)
|
||||
.toAttachment();
|
||||
const attachment = new Discord.MessageAttachment(image, "shop.png");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/fortniteshop:HEADER", { date: message.printDate(new Date(Date.now())) }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(message.translate("general/fortniteshop:HEADER", {
|
||||
date: message.printDate(new Date(Date.now()))
|
||||
}), this.client.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.attachFiles(attachment)
|
||||
.setImage("attachment://shop.png")
|
||||
.setColor(this.client.config.embed.color)
|
||||
|
|
|
@ -3,27 +3,33 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Github extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "github",
|
||||
dirname: __dirname,
|
||||
enabled: false,
|
||||
guildOnly: false,
|
||||
aliases: [ "git", "code" ],
|
||||
aliases: ["git", "code"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
const res = await fetch("https://api.github.com/repos/JonnyBro/JaBa-new");
|
||||
async run(message, args, data) {
|
||||
const res = await fetch("https://api.github.com/repos/JonnyBro/JaBa-new", {
|
||||
headers: `Authorization: ${this.config.githubToken}`
|
||||
});
|
||||
const json = await res.json();
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setDescription(`[${message.translate("general/github:CLICK_HERE")}](https://github.com/JonnyBro/JaBa-new)`)
|
||||
.addField("Stars", json.stargazers_count, true)
|
||||
.addField("Forks", json.forks_count, true)
|
||||
|
|
|
@ -3,22 +3,22 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Hastebin extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "hastebin",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "pastebin" ],
|
||||
aliases: ["pastebin"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const content = args.join(" ");
|
||||
if (!content) return message.error("general/hastebin:MISSING_TEXT");
|
||||
|
||||
|
@ -26,7 +26,9 @@ class Hastebin extends Command {
|
|||
const res = await fetch("https://hastebin.com/documents", {
|
||||
method: "POST",
|
||||
body: content,
|
||||
headers: { "Content-Type": "text/plain" }
|
||||
headers: {
|
||||
"Content-Type": "text/plain"
|
||||
}
|
||||
});
|
||||
|
||||
const json = await res.json();
|
||||
|
@ -39,7 +41,7 @@ class Hastebin extends Command {
|
|||
.setDescription(url)
|
||||
.setColor(data.config.embed.color);
|
||||
message.channel.send(embed);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
message.error("misc:ERR_OCCURRED");
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,41 +2,49 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Help extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "help",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "aide", "h", "commands" ],
|
||||
aliases: ["aide", "h", "commands"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
// if a command is provided
|
||||
async run(message, args, data) {
|
||||
if (args[0]) {
|
||||
const isCustom = (message.guild && data.guild.customCommands ? data.guild.customCommands.find((c) => c.name === args[0]) : false);
|
||||
|
||||
// if the command doesn't exist, error message
|
||||
const cmd = this.client.commands.get(args[0]) || this.client.commands.get(this.client.aliases.get(args[0]));
|
||||
if (!cmd && isCustom) {
|
||||
return message.error("general/help:CUSTOM", { cmd: args[0] });
|
||||
return message.error("general/help:CUSTOM", {
|
||||
cmd: args[0]
|
||||
});
|
||||
} else if (!cmd) {
|
||||
return message.error("general/help:NOT_FOUND", { search: args[0] });
|
||||
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`, { prefix: message.guild ? data.guild.prefix : "" });
|
||||
const examples = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:EXAMPLES`, { prefix: message.guild ? data.guild.prefix : "" });
|
||||
const usage = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, {
|
||||
prefix: message.guild ? data.guild.prefix : ""
|
||||
});
|
||||
const examples = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:EXAMPLES`, {
|
||||
prefix: message.guild ? data.guild.prefix : ""
|
||||
});
|
||||
|
||||
// Creates the help embed
|
||||
const groupEmbed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/help:CMD_TITLE", { prefix: message.guild ? data.guild.prefix : "", cmd: cmd.help.name }))
|
||||
.setAuthor(message.translate("general/help:CMD_TITLE", {
|
||||
prefix: message.guild ? data.guild.prefix : "",
|
||||
cmd: cmd.help.name
|
||||
}))
|
||||
.addField(message.translate("general/help:FIELD_DESCRIPTION"), description)
|
||||
.addField(message.translate("general/help:FIELD_USAGE"), usage)
|
||||
.addField(message.translate("general/help:FIELD_EXAMPLES"), examples)
|
||||
|
@ -45,7 +53,6 @@ class Help extends Command {
|
|||
.setColor(this.client.config.embed.color)
|
||||
.setFooter(this.client.config.embed.footer);
|
||||
|
||||
// and send the embed in the current channel
|
||||
return message.channel.send(groupEmbed);
|
||||
};
|
||||
|
||||
|
@ -62,7 +69,9 @@ class Help extends Command {
|
|||
const emojis = this.client.customEmojis;
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setDescription(message.translate("general/help:INFO", { prefix: message.guild ? data.guild.prefix : "" }))
|
||||
.setDescription(message.translate("general/help:INFO", {
|
||||
prefix: message.guild ? data.guild.prefix : ""
|
||||
}))
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
categories.sort().forEach((cat) => {
|
||||
|
@ -78,7 +87,13 @@ class Help extends Command {
|
|||
donateLink: "https://qiwi.com/n/JONNYBRO",
|
||||
owner: this.client.config.owner.id
|
||||
}));
|
||||
embed.setAuthor(message.translate("general/help:TITLE", { name: this.client.user.username }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }));
|
||||
embed.setAuthor(message.translate("general/help:TITLE", {
|
||||
name: this.client.user.username
|
||||
}), this.client.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}));
|
||||
return message.channel.send(embed);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Invitations extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "invitations",
|
||||
dirname: __dirname,
|
||||
|
@ -10,18 +10,17 @@ class Invitations extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_GUILD" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "MANAGE_GUILD"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) member = message.member;
|
||||
|
||||
// Gets the invites
|
||||
const invites = await message.guild.fetchInvites().catch(() => {});
|
||||
if (!invites) return message.error("misc:ERR_OCCURRED");
|
||||
|
||||
|
@ -31,12 +30,18 @@ class Invitations extends Command {
|
|||
if (member === message.member) {
|
||||
return message.error("general/invitations:NOBODY_AUTHOR");
|
||||
} else {
|
||||
return message.error("general/invitations:NOBODY_MEMBER", { member: member.user.tag });
|
||||
return message.error("general/invitations:NOBODY_MEMBER", {
|
||||
member: member.user.tag
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
const content = memberInvites.map((i) => {
|
||||
return message.translate("general/invitations:CODE", { uses: i.uses, code: i.code, channel: i.channel.toString() });
|
||||
return message.translate("general/invitations:CODE", {
|
||||
uses: i.uses,
|
||||
code: i.code,
|
||||
channel: i.channel.toString()
|
||||
});
|
||||
}).join("\n");
|
||||
let index = 0;
|
||||
memberInvites.forEach((invite) => index += invite.uses);
|
||||
|
|
|
@ -2,31 +2,33 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Invite extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "invite",
|
||||
dirname: __dirname,
|
||||
enabled: false,
|
||||
guildOnly: false,
|
||||
aliases: [ "i", "add", "vote" ],
|
||||
aliases: ["i", "add", "vote"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
const inviteLink = this.client.config.inviteURL || `https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=8`;
|
||||
const voteURL = this.client.config.voteURL || `https://discordbots.org/bot/${this.client.user.id}/vote`;
|
||||
const supportURL = this.client.config.supportURL || await this.client.functions.supportLink(this.client);
|
||||
async run(message, args, data) {
|
||||
const inviteLink = `https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=8`;
|
||||
const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`;
|
||||
const supportURL = await this.client.functions.supportLink(this.client);
|
||||
|
||||
if (args[0] && args[0] === "copy") return message.channel.send(inviteLink);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/invite:LINKS"))
|
||||
.setDescription(message.translate("general/invite:TIP", { prefix: data.guild.prefix || "" }))
|
||||
.setDescription(message.translate("general/invite:TIP", {
|
||||
prefix: data.guild.prefix || ""
|
||||
}))
|
||||
.addField(message.translate("general/invite:ADD"), inviteLink)
|
||||
.addField(message.translate("general/invite:VOTE"), voteURL)
|
||||
.addField(message.translate("general/invite:SUPPORT"), supportURL)
|
||||
|
|
|
@ -5,22 +5,22 @@ const Command = require("../../base/Command.js"),
|
|||
Sentry = require("@sentry/node");
|
||||
|
||||
class Minecraft extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "minecraft",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "mc" ],
|
||||
aliases: ["mc"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const ip = args[0];
|
||||
if (!ip) return message.error("general/minecraft:MISSING_IP");
|
||||
|
||||
|
@ -31,7 +31,7 @@ class Minecraft extends Command {
|
|||
};
|
||||
|
||||
if (ip.split(":").length > 1) {
|
||||
const ip = ip.split(":")
|
||||
const ip = ip.split(":");
|
||||
options = {
|
||||
type: "minecraft",
|
||||
host: ip[0],
|
||||
|
@ -39,7 +39,9 @@ class Minecraft extends Command {
|
|||
};
|
||||
};
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
let json = null;
|
||||
|
||||
|
@ -64,17 +66,23 @@ class Minecraft extends Command {
|
|||
const imgAttachment = new Discord.MessageAttachment(await imgRes.buffer(), "success.png");
|
||||
|
||||
const mcEmbed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/minecraft:FIELD_NAME", { ip: json.name }))
|
||||
.setAuthor(message.translate("general/minecraft:FIELD_NAME", {
|
||||
ip: json.name
|
||||
}))
|
||||
.addField(message.translate("general/minecraft:FIELD_VERSION"), json.raw.vanilla.raw.version.name)
|
||||
.addField(message.translate("general/minecraft:FIELD_CONNECTED"), message.translate("general/minecraft:PLAYERS", { count: (json.raw.players ? json.raw.players.online : json.players.length) }))
|
||||
.addField(message.translate("general/minecraft:FIELD_MAX"), message.translate("general/minecraft:PLAYERS", { count: (json.raw.players ? json.raw.players.max : json.maxplayers) }))
|
||||
.addField(message.translate("general/minecraft:FIELD_CONNECTED"), message.translate("general/minecraft:PLAYERS", {
|
||||
count: (json.raw.players ? json.raw.players.online : json.players.length)
|
||||
}))
|
||||
.addField(message.translate("general/minecraft:FIELD_MAX"), message.translate("general/minecraft:PLAYERS", {
|
||||
count: (json.raw.players ? json.raw.players.max : json.maxplayers)
|
||||
}))
|
||||
.addField(message.translate("general/minecraft:FIELD_STATUS"), message.translate("general/minecraft:ONLINE"))
|
||||
.addField(message.translate("general/minecraft:FIELD_IP"), json.connect)
|
||||
.setColor(data.config.embed.color)
|
||||
.setThumbnail(favicon)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
m.edit(null, [ mcEmbed, imgAttachment ]);
|
||||
m.edit(null, [mcEmbed, imgAttachment]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
const Command = require("../../base/Command.js"),
|
||||
Discord = require("discord.js");
|
||||
|
||||
const permissions = Object.keys(Discord.Permissions.FLAGS);
|
||||
|
||||
class Permissions extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "permissions",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "perms" ],
|
||||
aliases: ["perms"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message) {
|
||||
async run(message) {
|
||||
const member = message.mentions.members.first() || message.member;
|
||||
let text = "```\n" + `${message.translate("general/permissions:TITLE", { user: member.user.username, channel: message.channel.name })}\n\n`;
|
||||
const mPermissions = message.channel.permissionsFor(member);
|
||||
|
|
|
@ -1,24 +1,30 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Ping extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "ping",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "pong", "latency" ],
|
||||
aliases: ["pong", "latency"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES" ],
|
||||
botPermissions: ["SEND_MESSAGES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message) {
|
||||
message.sendT("general/ping:CONTENT", { ping: "..." }).then((m) => {
|
||||
m.sendT("general/ping:CONTENT", { ping: m.createdTimestamp - message.createdTimestamp }, { edit: true });
|
||||
async run(message) {
|
||||
message.sendT("general/ping:CONTENT", {
|
||||
ping: "..."
|
||||
}).then((m) => {
|
||||
m.sendT("general/ping:CONTENT", {
|
||||
ping: m.createdTimestamp - message.createdTimestamp
|
||||
}, {
|
||||
edit: true
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,25 +2,29 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Quote extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "quote",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "quoter" ],
|
||||
aliases: ["quoter"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
function embed(m) {
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(m.author.tag, m.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(m.author.tag, m.author.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setDescription(m.content)
|
||||
.setColor(m.member ? m.member.roles.highest ? m.member.roles.highest.color : data.config.embed.color : data.config.embed.color)
|
||||
.setFooter(m.guild.name + " | #" + m.channel.name)
|
||||
|
@ -45,7 +49,9 @@ class Quote extends Command {
|
|||
if (!channel) {
|
||||
message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => {
|
||||
message.delete();
|
||||
}).catch(() => { message.error("misc:CANNOT_DM") });
|
||||
}).catch(() => {
|
||||
message.error("misc:CANNOT_DM")
|
||||
});
|
||||
return;
|
||||
};
|
||||
};
|
||||
|
@ -54,7 +60,9 @@ class Quote extends Command {
|
|||
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") });
|
||||
}).catch(() => {
|
||||
message.error("misc:CANNOT_DM")
|
||||
});
|
||||
return;
|
||||
}).then((msg) => {
|
||||
message.delete();
|
||||
|
@ -64,7 +72,9 @@ class Quote extends Command {
|
|||
channel.messages.fetch(msgID).catch(() => {
|
||||
message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => {
|
||||
message.delete();
|
||||
}).catch(() => { message.error("misc:CANNOT_DM") });
|
||||
}).catch(() => {
|
||||
message.error("misc:CANNOT_DM")
|
||||
});
|
||||
return;
|
||||
}).then((msg) => {
|
||||
message.delete();
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
ms = require("ms");
|
||||
|
||||
class Remindme extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "remindme",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "reminder" ],
|
||||
aliases: ["reminder"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const time = args[0];
|
||||
if (!time || isNaN(ms(time))) return message.error("misc:INVALID_TIME");
|
||||
|
||||
|
@ -27,7 +27,7 @@ class Remindme extends Command {
|
|||
const rData = {
|
||||
message: msg,
|
||||
createdAt: Date.now(),
|
||||
sendAt: Date.now()+ms(time)
|
||||
sendAt: Date.now() + ms(time)
|
||||
};
|
||||
|
||||
if (!data.userData.reminds) data.userData.reminds = [];
|
||||
|
@ -38,7 +38,6 @@ class Remindme extends Command {
|
|||
data.userData.save();
|
||||
this.client.databaseCache.usersReminds.set(message.author.id, data.userData);
|
||||
|
||||
// Send success message
|
||||
message.success("general/remindme:SAVED");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Report extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "report",
|
||||
dirname: __dirname,
|
||||
|
@ -10,14 +10,14 @@ class Report extends Command {
|
|||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const repChannel = message.guild.channels.cache.get(data.guild.plugins.reports);
|
||||
if (!repChannel) return message.error("general/report:MISSING_CHANNEL");
|
||||
|
||||
|
@ -29,7 +29,13 @@ class Report extends Command {
|
|||
if (!rep) return message.error("general/report:MISSING_REASON");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/report:TITLE", { user: member.user.tag }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(message.translate("general/report:TITLE", {
|
||||
user: member.user.tag
|
||||
}), message.author.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.addField(message.translate("common:AUTHOR"), message.author.tag, true)
|
||||
.addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true)
|
||||
.addField(message.translate("common:REASON"), `**${rep}**`, true)
|
||||
|
@ -45,7 +51,9 @@ class Report extends Command {
|
|||
await m.react(error);
|
||||
});
|
||||
|
||||
message.success("general/report:SUCCESS", { channel: repChannel.toString() });
|
||||
message.success("general/report:SUCCESS", {
|
||||
channel: repChannel.toString()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Serverinfo extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "serverinfo",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "si" ],
|
||||
aliases: ["si"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let guild = message.guild;
|
||||
|
||||
if (args[0]) {
|
||||
|
@ -31,16 +31,30 @@ class Serverinfo extends Command {
|
|||
await guild.members.fetch();
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(guild.name, guild.iconURL({ dynamic: true }))
|
||||
.setThumbnail(guild.iconURL({ dynamic: true }))
|
||||
.setAuthor(guild.name, guild.iconURL({
|
||||
dynamic: true
|
||||
}))
|
||||
.setThumbnail(guild.iconURL({
|
||||
dynamic: true
|
||||
}))
|
||||
.addField(this.client.customEmojis.title + message.translate("common:NAME"), guild.name, true)
|
||||
.addField(this.client.customEmojis.calendar + message.translate("common:CREATION"), message.printDate(guild.createdAt), true)
|
||||
.addField(this.client.customEmojis.users + message.translate("common:MEMBERS"), message.translate("general/serverinfo:MEMBERS", { count: guild.members.cache.filter(m => !m.user.bot).size }) + " | " + message.translate("general/serverinfo:BOTS", { count: guild.members.cache.filter(m => m.user.bot).size }), true)
|
||||
.addField(this.client.customEmojis.users + message.translate("common:MEMBERS"), message.translate("general/serverinfo:MEMBERS", {
|
||||
count: guild.members.cache.filter(m => !m.user.bot).size
|
||||
}) + " | " + message.translate("general/serverinfo:BOTS", {
|
||||
count: guild.members.cache.filter(m => m.user.bot).size
|
||||
}), true)
|
||||
.addField(this.client.customEmojis.afk + message.translate("general/serverinfo:AFK_CHANNEL"), guild.afkChannel || message.translate("general/serverinfo:NO_AFK_CHANNEL"), true)
|
||||
.addField(this.client.customEmojis.id + message.translate("common:ID"), guild.id, true)
|
||||
.addField(this.client.customEmojis.crown + message.translate("common:OWNER"), guild.owner, true)
|
||||
.addField(this.client.customEmojis.boost + message.translate("general/serverinfo:BOOSTS"), guild.premiumSubscriptionCount || 0, true)
|
||||
.addField(this.client.customEmojis.channels + message.translate("common:CHANNELS"), message.translate("general/serverinfo:TEXT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "text").size }) + " | " + message.translate("general/serverinfo:VOICE_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "voice").size }) + " | " + message.translate("general/serverinfo:CAT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "category").size }), true)
|
||||
.addField(this.client.customEmojis.channels + message.translate("common:CHANNELS"), message.translate("general/serverinfo:TEXT_CHANNELS", {
|
||||
count: guild.channels.cache.filter(c => c.type === "text").size
|
||||
}) + " | " + message.translate("general/serverinfo:VOICE_CHANNELS", {
|
||||
count: guild.channels.cache.filter(c => c.type === "voice").size
|
||||
}) + " | " + message.translate("general/serverinfo:CAT_CHANNELS", {
|
||||
count: guild.channels.cache.filter(c => c.type === "category").size
|
||||
}), true)
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
|
|
|
@ -1,27 +1,28 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Setafk extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "setafk",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "afk" ],
|
||||
aliases: ["afk"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const reason = args.join(" ");
|
||||
if (!reason) return message.error("general/setafk:MISSING_REASON");
|
||||
|
||||
// Send success message
|
||||
message.success("general/setafk:SUCCESS", { reason });
|
||||
message.success("general/setafk:SUCCESS", {
|
||||
reason
|
||||
});
|
||||
|
||||
data.userData.afk = reason;
|
||||
data.userData.save();
|
||||
|
|
|
@ -3,22 +3,22 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class ShortURL extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "shorturl",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "minimize" ],
|
||||
aliases: ["minimize"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const url = args[0];
|
||||
if (!url) return message.error("general/shorturl:MISSING_URL");
|
||||
|
||||
|
|
|
@ -2,29 +2,33 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Someone extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "someone",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "somebody", "something" ],
|
||||
aliases: ["somebody", "something"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 1000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const member = message.guild.members.cache.random(1)[0];
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.addField(message.translate("common:USERNAME"), member.user.username, true)
|
||||
.addField(message.translate("common:DISCRIMINATOR"), member.user.discriminator, true)
|
||||
.addField(message.translate("common:ID"), member.user.id, true)
|
||||
.setThumbnail(member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setThumbnail(member.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setColor(data.config.embed.color);
|
||||
message.channel.send(embed);
|
||||
}
|
||||
|
|
|
@ -2,27 +2,29 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Staff extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "staff",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "stafflist", "staffliste" ],
|
||||
aliases: ["stafflist", "staffliste"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
await message.guild.members.fetch();
|
||||
const administrators = message.guild.members.cache.filter((m) => m.hasPermission("ADMINISTRATOR") && !m.user.bot);
|
||||
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.hasPermission("MANAGE_MESSAGES") && !m.user.bot);
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/staff:TITLE", { guild: message.guild.name }))
|
||||
.setAuthor(message.translate("general/staff:TITLE", {
|
||||
guild: message.guild.name
|
||||
}))
|
||||
.addField(message.translate("general/staff:ADMINS"), (administrators.size > 0 ? administrators.map((a) => `${this.client.customEmojis.status[a.presence.status]} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS")))
|
||||
.addField(message.translate("general/staff:MODS"), (moderators.size > 0 ? moderators.map((m) => `${this.client.customEmojis.status[m.presence.status]} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS")))
|
||||
.setColor(data.config.embed.color)
|
||||
|
|
|
@ -2,35 +2,42 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Stats extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "stats",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "statistics", "infobot", "botinfos", "bot-infos", "bot-info", "infos-bot", "info-bot" ],
|
||||
aliases: ["statistics", "infobot", "botinfos", "bot-infos", "bot-info", "infos-bot", "info-bot"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const statsEmbed = new Discord.MessageEmbed()
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer)
|
||||
.setAuthor(message.translate("common:STATS"))
|
||||
.setDescription(message.translate("general/stats:MADE"))
|
||||
.addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", { servers: this.client.guilds.cache.size, users: this.client.users.cache.size }), true)
|
||||
.addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", {
|
||||
servers: this.client.guilds.cache.size,
|
||||
users: this.client.users.cache.size
|
||||
}), true)
|
||||
.addField(this.client.customEmojis.version + " " + message.translate("general/stats:VERSIONS_TITLE"), `\`Discord.js : v${Discord.version}\`\n\`Nodejs : v${process.versions.node}\``, true)
|
||||
.addField(this.client.customEmojis.ram + " " + message.translate("general/stats:RAM_TITLE"), `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``, true)
|
||||
.addField(this.client.customEmojis.status.online + " " + message.translate("general/stats:ONLINE_TITLE"), message.translate("general/stats:ONLINE_CONTENT", { time: message.convertTime(Date.now()+this.client.uptime, "from", true) }))
|
||||
.addField(this.client.customEmojis.voice + " " + message.translate("general/stats:MUSIC_TITLE"), message.translate("general/stats:MUSIC_CONTENT", { count: this.client.voice.connections.size }))
|
||||
.addField(this.client.customEmojis.status.online + " " + message.translate("general/stats:ONLINE_TITLE"), message.translate("general/stats:ONLINE_CONTENT", {
|
||||
time: message.convertTime(Date.now() + this.client.uptime, "from", true)
|
||||
}))
|
||||
.addField(this.client.customEmojis.voice + " " + message.translate("general/stats:MUSIC_TITLE"), message.translate("general/stats:MUSIC_CONTENT", {
|
||||
count: this.client.voice.connections.size
|
||||
}))
|
||||
.addField(message.translate("general/stats:CREDITS_TITLE"), message.translate("general/stats:CREDITS_CONTENT", {
|
||||
donators: [ ":(" ].join("\n"),
|
||||
translators: [ "`Jonny_Bro#4226` (:flag_ru:)", "`[ДАННЫЕ УДАЛЕНЫ]#2789` (:flag_ua:)", "`FaxoNfuckyou#9398` и `Jonny_Bro#4226` (:flag_us:)" ].join("\n")
|
||||
donators: [":("].join("\n"),
|
||||
translators: ["`Jonny_Bro#4226` (:flag_ru:)", "`[ДАННЫЕ УДАЛЕНЫ]#2789` (:flag_ua:)", "`FaxoNfuckyou#9398` и `Jonny_Bro#4226` (:flag_us:)"].join("\n")
|
||||
}));
|
||||
|
||||
statsEmbed.addField(this.client.customEmojis.link + " " + message.translate("general/stats:LINKS_TITLE"), message.translate("misc:STATS_FOOTER", {
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Suggest extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "suggest",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "suggestion", "sugg" ],
|
||||
aliases: ["suggestion", "sugg"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const suggChannel = message.guild.channels.cache.get(data.guild.plugins.suggestions);
|
||||
if (!suggChannel) return message.error("general/suggest:MISSING_CHANNEL");
|
||||
|
||||
|
@ -25,7 +25,13 @@ class Suggest extends Command {
|
|||
if (!sugg) return message.error("general/suggest:MISSING_CONTENT");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("general/suggest:TITLE", { user: message.author.username }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor(message.translate("general/suggest:TITLE", {
|
||||
user: message.author.username
|
||||
}), message.author.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.addField(message.translate("common:AUTHOR"), `\`${message.author.username}#${message.author.discriminator}\``, true)
|
||||
.addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true)
|
||||
.addField(message.translate("common:CONTENT"), sugg)
|
||||
|
@ -40,7 +46,9 @@ class Suggest extends Command {
|
|||
await m.react(error);
|
||||
});
|
||||
|
||||
message.success("general/suggest:SUCCESS", { channel: suggChannel.toString() });
|
||||
message.success("general/suggest:SUCCESS", {
|
||||
channel: suggChannel.toString()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -5,22 +5,22 @@ const Command = require("../../base/Command.js"),
|
|||
const langs = ["afrikaans", "albanian", "amharic", "arabic", "armenian", "azerbaijani", "bangla", "basque", "belarusian", "bengali", "bosnian", "bulgarian", "burmese", "catalan", "cebuano", "chichewa", "corsican", "croatian", "czech", "danish", "dutch", "english", "esperanto", "estonian", "filipino", "finnish", "french", "frisian", "galician", "georgian", "german", "greek", "gujarati", "haitian creole", "hausa", "hawaiian", "hebrew", "hindi", "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian", "japanese", "javanese", "kannada", "kazakh", "khmer", "korean", "kurdish (kurmanji)", "kyrgyz", "lao", "latin", "latvian", "lithuanian", "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese", "maori", "marathi", "mongolian", "myanmar (burmese)", "nepali", "norwegian", "nyanja", "pashto", "persian", "polish", "portugese", "punjabi", "romanian", "russian", "samoan", "scottish gaelic", "serbian", "sesotho", "shona", "sindhi", "sinhala", "slovak", "slovenian", "somali", "spanish", "sundanese", "swahili", "swedish", "tajik", "tamil", "telugu", "thai", "turkish", "ukrainian", "urdu", "uzbek", "vietnamese", "welsh", "xhosa", "yiddish", "yoruba", "zulu"];
|
||||
|
||||
class Translate extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "translate",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "traduction", "translation", "trad" ],
|
||||
aliases: ["traduction", "translation", "trad"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
if (args[0] === "langs-list") {
|
||||
const langsList = "```css\n" + (langs.map((lang, i) => `${i + 1} - ${lang}`).join("\n")) + "```";
|
||||
message.author.send(langsList).then(() => {
|
||||
|
@ -31,7 +31,9 @@ class Translate extends Command {
|
|||
return;
|
||||
};
|
||||
|
||||
const pWait = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const pWait = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
if (!args[0]) return pWait.error("general/translate:MISSING_LANGUAGE", { prefix: data.guild.prefix }, { edit: true });
|
||||
if (!args[1]) return pWait.error("general/translate:MISSING_CONTENT", null, { edit: true });
|
||||
|
@ -40,18 +42,26 @@ class Translate extends Command {
|
|||
const language = args[0].toLowerCase();
|
||||
const toTranslate = args.slice(1).join(" ");
|
||||
|
||||
if (!langs.includes(language)) return pWait.error("general/translate:INVALID_LANGUAGE", { prefix: data.guild.prefix, search: language}, { edit: true });
|
||||
if (!langs.includes(language)) return pWait.error("general/translate:INVALID_LANGUAGE", { prefix: data.guild.prefix, search: language }, { edit: true });
|
||||
|
||||
const translated = await translate(toTranslate, { to: language });
|
||||
const translated = await translate(toTranslate, {
|
||||
to: language
|
||||
});
|
||||
|
||||
const resEmbed = new Discord.MessageEmbed()
|
||||
.setAuthor("Translator", this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setAuthor("Translator", this.client.user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.addField(translated.from.language.iso, "```" + toTranslate + "```")
|
||||
.addField(language, "```" + translated.text + "```")
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
return pWait.edit("", { embed: resEmbed });
|
||||
return pWait.edit("", {
|
||||
embed: resEmbed
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -3,22 +3,22 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Userinfo extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "userinfo",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "ui" ],
|
||||
aliases: ["ui"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
let displayPresence = true;
|
||||
|
||||
const isID = !isNaN(args[0]);
|
||||
|
@ -41,13 +41,23 @@ class Userinfo extends Command {
|
|||
if (message.guild) member = await message.guild.members.fetch(user).catch(() => {});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.setThumbnail(user.displayAvatarURL({ dynamic: true }))
|
||||
.setAuthor(user.tag, user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setThumbnail(user.displayAvatarURL({
|
||||
dynamic: true
|
||||
}))
|
||||
.addField(":man: " + message.translate("common:USERNAME"), user.username, true)
|
||||
.addField(this.client.customEmojis.discriminator + " " + message.translate("common:DISCRIMINATOR"), user.discriminator, true)
|
||||
.addField(this.client.customEmojis.bot + " " + message.translate("common:ROBOT"), (user.bot ? message.translate("common:YES") : message.translate("common:NO")), true)
|
||||
.addField(this.client.customEmojis.calendar + " " + message.translate("common:CREATION"), message.printDate(user.createdAt), true)
|
||||
.addField(this.client.customEmojis.avatar + " " + message.translate("common:AVATAR"), user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }))
|
||||
.addField(this.client.customEmojis.avatar + " " + message.translate("common:AVATAR"), user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
}))
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
|
@ -58,15 +68,19 @@ class Userinfo extends Command {
|
|||
|
||||
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.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(", ")));
|
||||
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, {
|
||||
headers: { "Authorization": this.client.config.apiKeys.dbl }
|
||||
headers: {
|
||||
"Authorization": this.client.config.apiKeys.dbl
|
||||
}
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!data.error) {
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Approved extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "approved",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Approved extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("approved", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("approved", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "approved.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Avatar extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "avatar",
|
||||
dirname: __dirname,
|
||||
|
@ -10,20 +10,25 @@ class Avatar extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
let user = await this.client.resolveUser(args[0]);
|
||||
if (!user) user = message.author;
|
||||
const avatarURL = user.displayAvatarURL({ size: 512, dynamic: true, format: "png" });
|
||||
if (message.content.includes("-v")) message.channel.send(`<${avatarURL}>`);
|
||||
const attachment = new Discord.MessageAttachment(avatarURL, `avatar.${avatarURL.split(".").pop().split("?")[0]}`);
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
size: 512,
|
||||
dynamic: true,
|
||||
format: "png"
|
||||
});
|
||||
|
||||
if (message.content.includes("link")) message.channel.send(`<${avatarURL}>`);
|
||||
|
||||
const attachment = new Discord.MessageAttachment(avatarURL, `avatar.${avatarURL.split(".").pop().split("?")[0]}`);
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class BatSlap extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "batslap",
|
||||
dirname: __dirname,
|
||||
|
@ -10,22 +10,34 @@ class BatSlap extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const users = [
|
||||
await this.client.resolveUser(args[0]) || message.author,
|
||||
await this.client.resolveUser(args[1]) || message.author
|
||||
];
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("batslap", { avatar: users[0].displayAvatarURL({ format: "png", size: 512 }), url: users[1].displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("batslap", {
|
||||
avatar: users[0].displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
}),
|
||||
url: users[1].displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "batslap.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Beautiful extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "beautiful",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Beautiful extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("beautiful", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("beautiful", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "beautiful.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
canvacord = require("canvacord");
|
||||
|
||||
class Bed extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "bed",
|
||||
dirname: __dirname,
|
||||
|
@ -11,28 +11,36 @@ class Bed extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const users = [
|
||||
await this.client.resolveUser(args[0]) || message.author,
|
||||
await this.client.resolveUser(args[1]) || message.author
|
||||
];
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
try {
|
||||
const buffer = await canvacord.Canvas.bed(users[0].displayAvatarURL({ format: "png" }), users[1].displayAvatarURL({ format: "png" }));
|
||||
const buffer = await canvacord.Canvas.bed(users[0].displayAvatarURL({
|
||||
format: "png"
|
||||
}), users[1].displayAvatarURL({
|
||||
format: "png"
|
||||
}));
|
||||
const attachment = new Discord.MessageAttachment(buffer, "bed.png");
|
||||
message.channel.send(attachment);
|
||||
m.delete();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
m.error("misc:ERROR_OCCURRED", null, { edit: true });
|
||||
m.error("misc:ERROR_OCCURRED", null, {
|
||||
edit: true
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Brazzers extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "brazzers",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Brazzers extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("brazzers", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("brazzers", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "brazzers.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Burn extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "burn",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Burn extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("burn", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("burn", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "burn.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Captcha extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "captcha",
|
||||
dirname: __dirname,
|
||||
|
@ -11,23 +11,25 @@ class Captcha extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
try {
|
||||
const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=captcha&username=${user.username}&url=${user.displayAvatarURL({ format: "png", size: 512 })}`));
|
||||
const json = await res.json();
|
||||
const attachment = new Discord.MessageAttachment(json.message, "captcha.png");
|
||||
message.channel.send(attachment);
|
||||
m.delete();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
m.error("misc:ERR_OCCURRED", null, {
|
||||
edit: true
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Challenger extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "challenger",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Challenger extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("challenger", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("challenger", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "challenger.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Clyde extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "clyde",
|
||||
dirname: __dirname,
|
||||
|
@ -11,28 +11,32 @@ class Clyde extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const text = args.join(" ");
|
||||
|
||||
if (!text) return message.error("images/clyde:MISSING_TEXT");
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
try {
|
||||
const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=clyde&text=${text}`));
|
||||
const json = await res.json();
|
||||
const attachment = new Discord.MessageAttachment(json.message, "clyde.png");
|
||||
message.channel.send(attachment);
|
||||
m.delete();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
m.error("misc:ERROR_OCCURRED", null, { edit: true });
|
||||
m.error("misc:ERROR_OCCURRED", null, {
|
||||
edit: true
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Dictator extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "dictator",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Dictator extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("dictator", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("dictator", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "dictator.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,24 +3,26 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Facepalm extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "facepalm",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "palm" ],
|
||||
aliases: ["palm"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author,
|
||||
m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
const canvas = Canvas.createCanvas(632, 357),
|
||||
ctx = canvas.getContext("2d");
|
||||
|
@ -30,7 +32,10 @@ class Facepalm extends Command {
|
|||
ctx.fillRect(0, 0, 632, 357);
|
||||
|
||||
// Draw avatar
|
||||
const avatar = await Canvas.loadImage(user.displayAvatarURL({ format: "png", size: 512 }));
|
||||
const avatar = await Canvas.loadImage(user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
}));
|
||||
ctx.drawImage(avatar, 199, 112, 235, 235);
|
||||
|
||||
// Draw layer
|
||||
|
@ -40,6 +45,7 @@ class Facepalm extends Command {
|
|||
const attachment = new Discord.MessageAttachment(canvas.toBuffer(), "facepalm.png");
|
||||
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Fire extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "fire",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Fire extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("fire", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("fire", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "fire.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Jail extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "jail",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Jail extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("jail", { url: user.displayAvatarURL({ format: "png", size: 1024 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("jail", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 1024
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "jail.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
fetch = require("node-fetch");
|
||||
|
||||
class Love extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "love",
|
||||
dirname: __dirname,
|
||||
|
@ -11,29 +11,33 @@ class Love extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const users = [
|
||||
await this.client.resolveUser(args[0]) || message.author,
|
||||
await this.client.resolveUser(args[1]) || message.author
|
||||
];
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
try {
|
||||
const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=ship&user1=${users[0].displayAvatarURL({ format: "png", size: 512 })}&user2=${users[1].displayAvatarURL({ format: "png", size: 512 })}`));
|
||||
const json = await res.json();
|
||||
const attachment = new Discord.MessageAttachment(json.message, "love.png");
|
||||
message.channel.send(attachment);
|
||||
m.delete();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
m.error("misc:ERROR_OCCURRED", null, { edit: true });
|
||||
m.error("misc:ERROR_OCCURRED", null, {
|
||||
edit: true
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Mission extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "mission",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Mission extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("images/mission:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("missionpassed", { url: user.displayAvatarURL({ format: "png", size: 2048 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("missionpassed", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 2048
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "mission.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
canvacord = require("canvacord");
|
||||
|
||||
class Phcomment extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "phcomment",
|
||||
dirname: __dirname,
|
||||
|
@ -11,14 +11,14 @@ class Phcomment extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
let user = await this.client.resolveUser(args[0]);
|
||||
let text = args.join(" ");
|
||||
|
||||
|
@ -36,15 +36,19 @@ class Phcomment extends Command {
|
|||
try {
|
||||
const buffer = await canvacord.Canvas.phub({
|
||||
username: user.username,
|
||||
image: user.displayAvatarURL({ format: "png" }),
|
||||
image: user.displayAvatarURL({
|
||||
format: "png"
|
||||
}),
|
||||
message: text
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "phcomment.png");
|
||||
message.channel.send(attachment);
|
||||
m.delete();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
m.error("misc:ERROR_OCCURRED", null, { edit: true });
|
||||
m.error("misc:ERROR_OCCURRED", null, {
|
||||
edit: true
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,32 +2,36 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Qrcode extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "qrcode",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "qr" ],
|
||||
aliases: ["qr"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const text = args.join(" ");
|
||||
if (!text) return message.error("images/qrcode:MISSING_TEXT");
|
||||
|
||||
const pleaseWait = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const pleaseWait = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setImage(`https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${text.replace(new RegExp(" ", "g"), "%20")}`)
|
||||
.setColor(data.config.embed.color);
|
||||
|
||||
pleaseWait.edit(message.translate("images/qrcode:SUCCESS"), { embed });
|
||||
pleaseWait.edit(message.translate("images/qrcode:SUCCESS"), {
|
||||
embed
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Rip extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "rip",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Rip extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("rip", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("rip", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "rip.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Scary extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "scary",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Scary extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("scary", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("scary", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "scary.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Tobecontinued extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "tobecontinued",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Tobecontinued extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("tobecontinued", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("tobecontinued", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "tobecontinued.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"),
|
|||
canvacord = require("canvacord");
|
||||
|
||||
class Trash extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "trash",
|
||||
dirname: __dirname,
|
||||
|
@ -11,19 +11,25 @@ class Trash extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await canvacord.Canvas.trash(user.displayAvatarURL({ format: "png", size: 512 }));
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await canvacord.Canvas.trash(user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
}));
|
||||
const attachment = new Discord.MessageAttachment(buffer, "trash.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Triggered extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "triggered",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,29 @@ class Triggered extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("triggered", { url: user.displayAvatarURL({ format: "png", size: 512 }), sepia: "true", invert: "true" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("triggered", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
}),
|
||||
sepia: "true",
|
||||
invert: "true"
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "triggered.gif");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Tweet extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "tweet",
|
||||
dirname: __dirname,
|
||||
enabled: false,
|
||||
guildOnly: false,
|
||||
aliases: [ "twitter" ],
|
||||
aliases: ["twitter"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = message.mentions.users.first() || message.author;
|
||||
const text = args.slice(1).join(" ");
|
||||
|
||||
|
@ -25,7 +25,9 @@ class Tweet extends Command {
|
|||
|
||||
if (!text) return message.error("images/tweet:MISSING_TEXT");
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
|
||||
await message.guild.members.fetch();
|
||||
const randomMembers = message.guild.members.cache.random(3);
|
||||
|
@ -39,6 +41,7 @@ class Tweet extends Command {
|
|||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "twitter.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Wanted extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "wanted",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Wanted extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("wanted", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("wanted", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "wanted.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Wasted extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "wasted",
|
||||
dirname: __dirname,
|
||||
|
@ -10,19 +10,27 @@ class Wasted extends Command {
|
|||
guildOnly: false,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const user = await this.client.resolveUser(args[0]) || message.author;
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const buffer = await this.client.AmeAPI.generate("wasted", { url: user.displayAvatarURL({ format: "png", size: 512 }) });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const buffer = await this.client.AmeAPI.generate("wasted", {
|
||||
url: user.displayAvatarURL({
|
||||
format: "png",
|
||||
size: 512
|
||||
})
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(buffer, "wasted.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,22 +3,22 @@ const Command = require("../../base/Command.js"),
|
|||
canvacord = require("canvacord");
|
||||
|
||||
class YouTubeComment extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "youtube-comment",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [ "ytcomment" ],
|
||||
aliases: ["ytcomment"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 5000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
let user = await this.client.resolveUser(args[0]);
|
||||
let text = args.join(" ");
|
||||
|
||||
|
@ -30,14 +30,19 @@ class YouTubeComment extends Command {
|
|||
|
||||
if (!text) return message.error("images/phcomment:MISSING_TEXT"); // same text as phcomment
|
||||
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" });
|
||||
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
||||
prefixEmoji: "loading"
|
||||
});
|
||||
const image = await canvacord.Canvas.youtube({
|
||||
username: user.username,
|
||||
avatar: user.displayAvatarURL({ format: "png" }),
|
||||
avatar: user.displayAvatarURL({
|
||||
format: "png"
|
||||
}),
|
||||
content: text
|
||||
});
|
||||
const attachment = new Discord.MessageAttachment(image, "ytb-comment.png");
|
||||
m.delete();
|
||||
|
||||
message.channel.send(attachment);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,22 +2,22 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Announcement extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "announcement",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "MENTION_EVERYONE" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
memberPermissions: ["MENTION_EVERYONE"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const text = args.join(" ");
|
||||
if (!text) return message.error("moderation/announcement:MISSING_TEXT");
|
||||
if (text.length > 1030) return message.error("moderation/announcement:TOO_LONG");
|
||||
|
@ -26,7 +26,10 @@ class Announcement extends Command {
|
|||
|
||||
let mention = "";
|
||||
const msg = await message.sendT("moderation/announcement:MENTION_PROMPT");
|
||||
const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 240000 });
|
||||
const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, {
|
||||
time: 240000
|
||||
});
|
||||
|
||||
collector.on("collect", async (tmsg) => {
|
||||
if (tmsg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) {
|
||||
tmsg.delete();
|
||||
|
@ -38,7 +41,9 @@ class Announcement extends Command {
|
|||
tmsg.delete();
|
||||
msg.delete();
|
||||
const tmsg1 = await message.sendT("moderation/announcement:MENTION_TYPE_PROMPT");
|
||||
const c = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 60000 });
|
||||
const c = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, {
|
||||
time: 60000
|
||||
});
|
||||
c.on("collect", (m) => {
|
||||
if (m.content.toLowerCase() === "here") {
|
||||
mention = "@here";
|
||||
|
@ -55,17 +60,13 @@ class Announcement extends Command {
|
|||
};
|
||||
});
|
||||
c.on("end", (collected, reason) => {
|
||||
if (reason === "time") {
|
||||
return message.error("misc:TIMES_UP");
|
||||
};
|
||||
if (reason === "time") return message.error("misc:TIMES_UP");
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
collector.on("end", (collected, reason) => {
|
||||
if (reason === "time") {
|
||||
return message.error("misc:TIMES_UP");
|
||||
};
|
||||
if (reason === "time") return message.error("misc:TIMES_UP");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("moderation/announcement:TITLE"))
|
||||
|
|
|
@ -2,32 +2,37 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Ban extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "ban",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [ "BAN_MEMBERS" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "BAN_MEMBERS" ],
|
||||
memberPermissions: ["BAN_MEMBERS"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "BAN_MEMBERS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const user = await this.client.resolveUser(args[0]);
|
||||
if (!user) return message.error("moderation/ban:MISSING_MEMBER");
|
||||
|
||||
const memberData = message.guild.members.cache.get(user.id) ? await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }) : null;
|
||||
const memberData = message.guild.members.cache.get(user.id) ? await this.client.findOrCreateMember({
|
||||
id: user.id,
|
||||
guildID: message.guild.id
|
||||
}) : null;
|
||||
|
||||
if (user.id === message.author.id) return message.error("moderation/ban:YOURSELF");
|
||||
|
||||
// If the user is already banned
|
||||
const banned = await message.guild.fetchBans();
|
||||
if (banned.some((m) => m.user.id === user.id)) return message.error("moderation/ban:ALREADY_BANNED", { username: user.tag });
|
||||
if (banned.some((m) => m.user.id === user.id)) return message.error("moderation/ban:ALREADY_BANNED", {
|
||||
username: user.tag
|
||||
});
|
||||
|
||||
// Gets the ban reason
|
||||
let reason = args.slice(1).join(" ");
|
||||
|
@ -37,7 +42,7 @@ class Ban extends Command {
|
|||
if (member) {
|
||||
const memberPosition = member.roles.highest.position;
|
||||
const moderationPosition = message.member.roles.highest.position;
|
||||
if (message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition))return message.error("moderation/ban:SUPERIOR");
|
||||
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");
|
||||
};
|
||||
|
||||
|
@ -49,7 +54,9 @@ class Ban extends Command {
|
|||
})).catch(() => {});
|
||||
|
||||
// Ban the user
|
||||
message.guild.members.ban(user, { reason } ).then(() => {
|
||||
message.guild.members.ban(user, {
|
||||
reason
|
||||
}).then(() => {
|
||||
// Send a success message in the current channel
|
||||
message.sendT("moderation/ban:BANNED", {
|
||||
username: user.tag,
|
||||
|
@ -79,7 +86,9 @@ class Ban extends Command {
|
|||
const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs);
|
||||
if (!channel) return;
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("moderation/ban:CASE", { count: data.guild.casesCount }))
|
||||
.setAuthor(message.translate("moderation/ban:CASE", {
|
||||
count: data.guild.casesCount
|
||||
}))
|
||||
.addField(message.translate("common:USER"), `\`${user.tag}\` (${user.toString()})`, true)
|
||||
.addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true)
|
||||
.addField(message.translate("common:REASON"), reason, true)
|
||||
|
|
|
@ -2,27 +2,27 @@ const Command = require("../../base/Command.js"),
|
|||
Discord = require("discord.js");
|
||||
|
||||
class Checkinvites extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "checkinvites",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "checkinvite", "checki" ],
|
||||
aliases: ["checkinvite", "checki"],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
async run(message, args, data) {
|
||||
const members = message.guild.members;
|
||||
|
||||
const withInvite = [];
|
||||
members.cache.forEach((m) => {
|
||||
const possibleLinks = m.user.presence.activities.map((a) => [ a.state, a.details, a.name ]).flat();
|
||||
const possibleLinks = m.user.presence.activities.map((a) => [a.state, a.details, a.name]).flat();
|
||||
const inviteLinks = possibleLinks.filter((l) => /(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(l));
|
||||
if (inviteLinks.length > 0) {
|
||||
withInvite.push({
|
||||
|
@ -40,7 +40,11 @@ class Checkinvites extends Command {
|
|||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
message.channel.send(embed);
|
||||
const m = await message.channel.send(embed);
|
||||
|
||||
setTimeout(function () {
|
||||
m.delete();
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Clear extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "clear",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "clear", "bulkdelete", "purge" ],
|
||||
memberPermissions: [ "MANAGE_MESSAGES" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_MESSAGES" ],
|
||||
aliases: ["clear", "bulkdelete", "purge"],
|
||||
memberPermissions: ["MANAGE_MESSAGES"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "MANAGE_MESSAGES"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
if (args[0] === "all") {
|
||||
message.sendT("moderation/clear:ALL_CONFIRM");
|
||||
await message.channel.awaitMessages((m) => (m.author.id === message.author.id) && (m.content === "confirm"), {
|
||||
|
@ -40,7 +40,9 @@ class Clear extends Command {
|
|||
|
||||
const user = message.mentions.users.first();
|
||||
|
||||
let messages = await message.channel.messages.fetch({limit:100});
|
||||
let messages = await message.channel.messages.fetch({
|
||||
limit: 100
|
||||
});
|
||||
messages = messages.array();
|
||||
if (user) messages = messages.filter((m) => m.author.id === user.id);
|
||||
if (messages.length > amount) messages.length = parseInt(amount, 10);
|
||||
|
@ -53,12 +55,17 @@ class Clear extends Command {
|
|||
let toDelete = null;
|
||||
|
||||
if (user) {
|
||||
toDelete = await message.success("moderation/clear:CLEARED_MEMBER", { amount: --amount, username: user.tag });
|
||||
toDelete = await message.success("moderation/clear:CLEARED_MEMBER", {
|
||||
amount: --amount,
|
||||
username: user.tag
|
||||
});
|
||||
} else {
|
||||
toDelete = await message.success("moderation/clear:CLEARED", { amount: --amount });
|
||||
toDelete = await message.success("moderation/clear:CLEARED", {
|
||||
amount: --amount
|
||||
});
|
||||
};
|
||||
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
toDelete.delete();
|
||||
}, 2000);
|
||||
}
|
||||
|
|
|
@ -1,29 +1,34 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Clearsanctions extends Command {
|
||||
constructor (client) {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "clearsanctions",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [ "clearwarns" ],
|
||||
memberPermissions: [ "MANAGE_MESSAGES" ],
|
||||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
||||
aliases: ["clearwarns"],
|
||||
memberPermissions: ["MANAGE_MESSAGES"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 2000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args) {
|
||||
async run(message, args) {
|
||||
const member = await this.client.resolveMember(args[0], message.guild);
|
||||
if (!member) return message.error("moderation/clear-sanctions:MISSING_MEMBER");
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildID: message.guild.id
|
||||
});
|
||||
memberData.sanctions = [];
|
||||
memberData.save();
|
||||
message.success("moderation/clear-sanctions:SUCCESS", { username: member.user.tag });
|
||||
message.success("moderation/clear-sanctions:SUCCESS", {
|
||||
username: member.user.tag
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue