mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
Принять изменения
This commit is contained in:
commit
b12aadc755
51 changed files with 185 additions and 199 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -6,13 +6,12 @@ node_modules
|
|||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
# Fortnite Shop images
|
||||
assets/img/fortnite/shop/**/*.png
|
||||
!assets/img/fortnite/shop/**/example-shop.png
|
||||
|
||||
# DB
|
||||
giveaways.json
|
||||
|
||||
# Backups
|
||||
backups
|
||||
|
||||
# Mac OS files
|
||||
.DS_Store
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
# JaBa-new
|
||||
# JaBa
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 921 KiB |
Binary file not shown.
Before Width: | Height: | Size: 158 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
|
@ -53,7 +53,6 @@ module.exports = mongoose.model("Guild", new Schema({
|
|||
modlogs: false, // the channel in which the moderation logs (mute, kick, ban, etc...) will be sent
|
||||
birthdays: false, // the channel in which birtdays announcements will be sent
|
||||
reports: false, // the channel in which the reports will be sent
|
||||
fortniteshop: false, // the channel in which the fortnite shop image will be sent at 2.05am
|
||||
logs: false // the channel in which the logs (message deleted, etc...) will be sent
|
||||
}},
|
||||
slowmode: { type: Object, default: { // Servers slowmode
|
||||
|
|
|
@ -107,10 +107,12 @@ userSchema.method("getAchievements", async function() {
|
|||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.invite.achieved ? "_colored" : ""}7.png`)
|
||||
];
|
||||
let dim = 0;
|
||||
|
||||
for (let i = 0; i < images.length; i++) {
|
||||
await ctx.drawImage(images[i], dim, 10, 350, 200);
|
||||
dim += 200;
|
||||
};
|
||||
|
||||
return canvas.toBuffer();
|
||||
});
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ const Command = require("../../base/Command.js"),
|
|||
backup = require("discord-backup"),
|
||||
Sentry = require("@sentry/node");
|
||||
|
||||
backup.setStorageFolder(__dirname + "../../../backups");
|
||||
|
||||
class Backup extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
|
@ -15,7 +17,7 @@ class Backup extends Command {
|
|||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ADMINISTRATOR"],
|
||||
nsfw: false,
|
||||
ownerOnly: false,
|
||||
cooldown: 10000
|
||||
cooldown: 20000
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -50,24 +52,21 @@ class Backup extends Command {
|
|||
max: 1,
|
||||
time: 20000,
|
||||
errors: ["time"]
|
||||
}).catch(() => {
|
||||
// if the author of the commands does not confirm the backup loading
|
||||
return message.error("misc:TIMES_UP");
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
return message.error("administration/backup:TIMES_UP");
|
||||
});
|
||||
// When the author of the command has confirmed that he wants to load the backup on his server
|
||||
message.author.send(message.translate("administration/backup:START_LOADING"));
|
||||
// Load the backup
|
||||
|
||||
backup.load(backupID, message.guild).then(() => {
|
||||
// When the backup is loaded, delete them from the server
|
||||
backup.remove(backupID);
|
||||
message.author.send(message.translate("administration/backup:LOAD_SUCCESS"));
|
||||
}).catch((err) => {
|
||||
Sentry.captureException(err);
|
||||
// If an error occurenced
|
||||
console.error(err);
|
||||
return message.error("misc:ERR_OCCURRED");
|
||||
});
|
||||
}).catch(() => {
|
||||
// if the backup wasn't found
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
return message.error("administration/backup:NO_BACKUP_FOUND", {
|
||||
backupID
|
||||
});
|
||||
|
@ -76,22 +75,47 @@ class Backup extends Command {
|
|||
const backupID = args[1];
|
||||
if (!backupID) return message.error("administration/backup:MISSING_BACKUP_ID");
|
||||
|
||||
backup.fetch(backupID).then(async (backupInfos) => {
|
||||
backup.fetch(backupID).then(async (backupInfo) => {
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("administration/backup:TITLE_INFO"))
|
||||
// Display the backup ID
|
||||
.addField(message.translate("administration/backup:TITLE_ID"), backupInfos.id, true)
|
||||
// Displays the server from which this backup comes
|
||||
.addField(message.translate("administration/backup:TITLE_SERVER_ID"), backupInfos.data.guildID, true)
|
||||
// Display the size (in mb) of the backup
|
||||
.addField(message.translate("administration/backup:TITLE_SIZE"), `${backupInfos.size}mb`, true)
|
||||
// Display when the backup was created
|
||||
.addField(message.translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfos.data.createdTimestamp)), true)
|
||||
.setAuthor({
|
||||
name: message.translate("administration/backup:TITLE_INFO")
|
||||
})
|
||||
.addField(message.translate("administration/backup:TITLE_ID"), backupInfo.id, true)
|
||||
.addField(message.translate("administration/backup:TITLE_SERVER_ID"), backupInfo.data.guildID.toString(), true)
|
||||
.addField(message.translate("administration/backup:TITLE_SIZE"), `${backupInfo.size} kb`, true)
|
||||
.addField(message.translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfo.data.createdTimestamp)), true)
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
message.channel.send(embed);
|
||||
}).catch(() => {
|
||||
// if the backup wasn't found
|
||||
.setFooter({
|
||||
text: data.config.embed.footer
|
||||
});
|
||||
message.channel.send({
|
||||
embeds: [embed]
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
return message.error("administration/backup:NO_BACKUP_FOUND", {
|
||||
backupID
|
||||
});
|
||||
});
|
||||
} else if (status === "remove") {
|
||||
const backupID = args[1];
|
||||
if (!backupID) return message.error("administration/backup:MISSING_BACKUP_ID");
|
||||
|
||||
backup.fetch(backupID).then(async () => {
|
||||
message.sendT("administration/backup:REMOVE_CONFIRMATION");
|
||||
await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "confirm"), {
|
||||
max: 1,
|
||||
time: 20000,
|
||||
errors: ["time"]
|
||||
}).catch(() => {
|
||||
return message.error("administration/backup:TIMES_UP");
|
||||
});
|
||||
|
||||
backup.remove(backupID).then(async () => {
|
||||
message.success("administration/backup:SUCCESS_REMOVED");
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
return message.error("administration/backup:NO_BACKUP_FOUND", {
|
||||
backupID
|
||||
});
|
||||
|
|
|
@ -61,9 +61,6 @@ class Configuration extends Command {
|
|||
}) + "\n" +
|
||||
message.translate("administration/configuration:BIRTHDAYS", {
|
||||
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : message.translate("common:NOT_DEFINED")
|
||||
}) + "\n" +
|
||||
message.translate("administration/configuration:FORTNITESHOP", {
|
||||
channel: guildData.plugins.fortniteshop ? `<#${guildData.plugins.fortniteshop}>` : message.translate("common:NOT_DEFINED")
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -18,45 +18,54 @@ class Achievements extends Command {
|
|||
}
|
||||
|
||||
async run(message, args, data) {
|
||||
const arg = args[0] || message.author
|
||||
let member = await this.client.resolveMember(arg, message.guild);
|
||||
if (!member) member = message.member;
|
||||
if (member.user.bot) return message.error("economy/profile:BOT_USER");
|
||||
|
||||
const userData = (member.id === message.author.id ? data.userData : await this.client.findOrCreateUser({
|
||||
id: member.id
|
||||
}));
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("economy/achievements:TITLE"))
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer);
|
||||
|
||||
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))
|
||||
now: userData.achievements.firstCommand.progress.now,
|
||||
total: userData.achievements.firstCommand.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.firstCommand.progress.now / 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))
|
||||
now: userData.achievements.work.progress.now,
|
||||
total: userData.achievements.work.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.work.progress.now / 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))
|
||||
now: userData.achievements.married.progress.now,
|
||||
total: userData.achievements.married.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.married.progress.now / 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))
|
||||
now: userData.achievements.slots.progress.now,
|
||||
total: userData.achievements.slots.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.slots.progress.now / 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))
|
||||
now: userData.achievements.tip.progress.now,
|
||||
total: userData.achievements.tip.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.tip.progress.now / 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))
|
||||
now: userData.achievements.rep.progress.now,
|
||||
total: userData.achievements.rep.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.rep.progress.now / 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))
|
||||
now: userData.achievements.invite.progress.now,
|
||||
total: userData.achievements.invite.progress.total,
|
||||
percent: Math.round(100 * (userData.achievements.invite.progress.now / userData.achievements.invite.progress.total))
|
||||
}));
|
||||
|
||||
message.channel.send(embed);
|
||||
|
|
|
@ -26,7 +26,13 @@ class Pay extends Command {
|
|||
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));
|
||||
<<<<<<< HEAD
|
||||
if (amount > data.memberData.money) return message.error("economy/pay:ENOUGH_MONEY", { amount: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDITS:1"), message.translate("misc:NOUNS:CREDITS:2"), message.translate("misc:NOUNS:CREDITS:5"))}` });
|
||||
=======
|
||||
if (amount > data.memberData.money) return message.error("economy/pay:ENOUGH_MONEY", {
|
||||
amount: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDITS:1"), message.translate("misc:NOUNS:CREDITS:2"), message.translate("misc:NOUNS:CREDITS:5"))}`
|
||||
});
|
||||
>>>>>>> discordjs-13
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({
|
||||
id: member.id,
|
||||
|
@ -40,7 +46,7 @@ class Pay extends Command {
|
|||
memberData.save();
|
||||
|
||||
message.success("economy/pay:SUCCESS", {
|
||||
amount: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
amount: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
username: member.user.tag
|
||||
});
|
||||
}
|
||||
|
|
|
@ -81,7 +81,19 @@ class Profile extends Command {
|
|||
.setFooter(data.config.embed.footer) // Sets the footer of the embed
|
||||
.setTimestamp();
|
||||
|
||||
<<<<<<< HEAD
|
||||
message.channel.send(profileEmbed); // Send the embed in the current channel
|
||||
=======
|
||||
const buffer = await userData.getAchievements();
|
||||
|
||||
message.channel.send({
|
||||
embeds: [profileEmbed],
|
||||
files: [{
|
||||
name: "achievements.png",
|
||||
attachment: buffer
|
||||
}]
|
||||
}); // Send the embed in the current channel
|
||||
>>>>>>> discordjs-13
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -80,7 +80,11 @@ class Work extends Command {
|
|||
data.memberData.save();
|
||||
|
||||
const messageOptions = {
|
||||
<<<<<<< HEAD
|
||||
embed
|
||||
=======
|
||||
embeds: [embed]
|
||||
>>>>>>> discordjs-13
|
||||
};
|
||||
if (!data.userData.achievements.work.achieved) {
|
||||
data.userData.achievements.work.progress.now += 1;
|
||||
|
|
|
@ -66,8 +66,9 @@ class Number extends Command {
|
|||
});
|
||||
userdata.money = userdata.money + won;
|
||||
userdata.save();
|
||||
collector.stop(msg.author.username);
|
||||
};
|
||||
|
||||
collector.stop();
|
||||
};
|
||||
if (parseInt(msg.content) < number) message.error("fun/number:BIG", {
|
||||
user: msg.author.toString(),
|
||||
|
|
|
@ -6,7 +6,7 @@ class TicTacToe extends Command {
|
|||
super(client, {
|
||||
name: "tictactoe",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
guildOnly: false,
|
||||
aliases: ["ttt"],
|
||||
memberPermissions: [],
|
||||
|
|
|
@ -29,6 +29,7 @@ class Serverinfo extends Command {
|
|||
};
|
||||
|
||||
await guild.members.fetch();
|
||||
const owner = await guild.fetchOwner();
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(guild.name, guild.iconURL({
|
||||
|
@ -45,8 +46,8 @@ class Serverinfo extends Command {
|
|||
)
|
||||
.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.crown + message.translate("common:OWNER"), owner.toString(), true)
|
||||
.addField(this.client.customEmojis.boost + message.translate("general/serverinfo:BOOSTS"), guild.premiumSubscriptionCount || "0", true)
|
||||
.addField(this.client.customEmojis.channels + message.translate("common:CHANNELS"),
|
||||
`${guild.channels.cache.filter(c => c.type === "text").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "text").size, message.translate("misc:NOUNS:TEXT:1"), message.translate("misc:NOUNS:TEXT:2"), message.translate("misc:NOUNS:TEXT:5"))}` +
|
||||
"\n" + `${guild.channels.cache.filter(c => c.type === "voice").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "voice").size, message.translate("misc:NOUNS:VOICE:1"), message.translate("misc:NOUNS:VOICE:2"), message.translate("misc:NOUNS:VOICE:5"))}` +
|
||||
|
|
|
@ -24,7 +24,7 @@ class Announcement extends Command {
|
|||
|
||||
message.delete().catch(() => {});
|
||||
|
||||
let mention = "";
|
||||
let mention = null;
|
||||
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
|
||||
|
|
|
@ -23,7 +23,7 @@ class Poll extends Command {
|
|||
|
||||
message.delete().catch(() => {});
|
||||
|
||||
let mention = "";
|
||||
let mention = null;
|
||||
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
|
||||
|
|
|
@ -23,7 +23,7 @@ class AutoPlay extends Command {
|
|||
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
||||
if (!queue) return message.error("music/play:NOT_PLAYING");
|
||||
|
||||
const autoplay = queue.toggleAutoplay()
|
||||
const autoplay = queue.toggleAutoplay();
|
||||
|
||||
message.success(`music/autoplay:SUCCESS_${autoplay ? "ENABLED" : "DISABLED"}`);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,16 @@ class Np extends Command {
|
|||
// Gets the current song
|
||||
const track = queue.songs[0];
|
||||
|
||||
const status = queue =>
|
||||
`Фильтры: \`${queue.filters.join(", ")
|
||||
|| "Выкл"}\` | Повтор: \`${
|
||||
queue.repeatMode
|
||||
? queue.repeatMode === 2
|
||||
? "Очереди"
|
||||
: "Трека"
|
||||
: "Выкл"
|
||||
}\` | Автовоспроизведение: \`${queue.autoplay ? "Вкл" : "Выкл"}\``;
|
||||
|
||||
// Generate discord embed to display song informations
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setAuthor(message.translate("music/queue:TITLE"))
|
||||
|
@ -34,6 +44,7 @@ class Np extends Command {
|
|||
.addField(message.translate("music/np:T_TITLE"), `[${track.name}](${track.url})`)
|
||||
.addField(message.translate("music/np:T_CHANNEL"), track.uploader.name ? track.uploader.name : "Отсутствует")
|
||||
.addField(message.translate("music/np:T_DURATION"), `${queue.formattedCurrentTime} / ${track.formattedDuration}`)
|
||||
.addField(message.translate("music/np:T_CONF"), status(queue))
|
||||
.setColor(data.config.embed.color)
|
||||
.setFooter(data.config.embed.footer)
|
||||
.setTimestamp();
|
||||
|
|
|
@ -17,11 +17,10 @@ class Play extends Command {
|
|||
}
|
||||
|
||||
async run(message, args) {
|
||||
const name = args.join(" ");
|
||||
if (!name) return message.error("music/play:MISSING_SONG_NAME");
|
||||
|
||||
const voice = message.member.voice.channel;
|
||||
const name = args.join(" ");
|
||||
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
||||
if (!name) return message.error("music/play:MISSING_SONG_NAME");
|
||||
|
||||
// Check my permissions
|
||||
const perms = voice.permissionsFor(this.client.user);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Queue extends Command {
|
|||
});
|
||||
}
|
||||
|
||||
async run(message, args, data) {
|
||||
async run(message, args, data, interaction) {
|
||||
const voice = message.member.voice.channel;
|
||||
const queue = this.client.player.getQueue(message);
|
||||
|
||||
|
@ -44,15 +44,15 @@ class Queue extends Command {
|
|||
}))
|
||||
.addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`);
|
||||
|
||||
FieldsEmbed.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : [])
|
||||
FieldsEmbed
|
||||
.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : [])
|
||||
.setAuthorizedUsers([message.author.id])
|
||||
.setChannel(message.channel)
|
||||
.setElementsPerPage(5)
|
||||
.setDeleteOnTimeout(true)
|
||||
.setPageIndicator(true)
|
||||
.formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`);
|
||||
|
||||
FieldsEmbed.build();
|
||||
.formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`)
|
||||
.build();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ class Seek extends Command {
|
|||
async run(message, args) {
|
||||
const voice = message.member.voice.channel;
|
||||
const queue = this.client.player.getQueue(message);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
const time = ms(args[0]) / 1000;
|
||||
>>>>>>> discordjs-13
|
||||
|
||||
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
||||
if (!queue) return message.error("music/play:NOT_PLAYING");
|
||||
|
|
|
@ -123,9 +123,6 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
|
|||
if (data.modlogs === req.translate("common:NO_CHANNEL")) guildData.plugins.modlogs = false;
|
||||
else guildData.plugins.modlogs = guild.channels.cache.find((ch) => "#" + ch.name === data.modlogs).id;
|
||||
|
||||
if (data.fortniteshop === req.translate("common:NO_CHANNEL")) guildData.plugins.fortniteshop = false;
|
||||
else guildData.plugins.fortniteshop = guild.channels.cache.find((ch) => "#" + ch.name === data.fortniteshop).id;
|
||||
|
||||
if (data.birthdays === req.translate("common:NO_CHANNEL")) guildData.plugins.birthdays = false;
|
||||
else guildData.plugins.birthdays = guild.channels.cache.find((ch) => "#" + ch.name === data.birthdays).id;
|
||||
|
||||
|
|
|
@ -194,6 +194,19 @@
|
|||
<div class="col-md-12">
|
||||
<pre class="brush: html">
|
||||
-----------------------------------------------------------------------------------------
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
JaBa v3.2
|
||||
-----------------------------------------------------------------------------------------
|
||||
Изменения
|
||||
- Переход на discord.js v13.
|
||||
Обновление очень большое, обязательно сообщайте мне если найдёте ошибку!
|
||||
|
||||
Примечания
|
||||
- tictactoe отключена до обновления модуля на discord.js 13!
|
||||
|
||||
-----------------------------------------------------------------------------------------
|
||||
>>>>>>> discordjs-13
|
||||
JaBa v3.1.6
|
||||
-----------------------------------------------------------------------------------------
|
||||
Исправления
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
<<<<<<< HEAD
|
||||
<div class="form-group">
|
||||
<label><%= translate("common:FORTNITESHOP") %></label>
|
||||
<select class="form-control" name="fortniteshop">
|
||||
|
@ -185,6 +186,8 @@
|
|||
<% } %>
|
||||
</select>
|
||||
</div>
|
||||
=======
|
||||
>>>>>>> discordjs-13
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
|
|
|
@ -33,10 +33,6 @@ module.exports = class {
|
|||
const checkReminds = require("../helpers/checkReminds");
|
||||
checkReminds.init(client);
|
||||
|
||||
// DAILY SHOP FORTNITE
|
||||
const fortniteShop = require("../helpers/fortniteShop");
|
||||
fortniteShop.init(client);
|
||||
|
||||
// Start the dashboard
|
||||
if (client.config.dashboard.enabled) client.dashboard.load(client);
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ module.exports = {
|
|||
}))
|
||||
.addField(client.translate("common:MESSAGE"), r.message)
|
||||
.setColor(client.config.embed.color)
|
||||
.setFooter(client.config.embed.footer);
|
||||
dUser.send(embed);
|
||||
.setFooter({ text: client.config.embed.footer });
|
||||
dUser.send({ embeds: [embed] });
|
||||
});
|
||||
user.reminds = user.reminds.filter((r) => r.sendAt >= dateNow);
|
||||
user.save();
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
|||
guild.data = guildData;
|
||||
if (member) {
|
||||
guild.channels.cache.forEach((channel) => {
|
||||
const permOverwrites = channel.permissionOverwrites.get(member.id);
|
||||
const permOverwrites = channel.permissionOverwrites.cache.get(member.id);
|
||||
if (permOverwrites) permOverwrites.delete();
|
||||
});
|
||||
};
|
||||
|
@ -47,7 +47,7 @@ module.exports = {
|
|||
count: memberData.mute.case
|
||||
}))
|
||||
.setColor("#f44271")
|
||||
.setFooter(guild.client.config.embed.footer);
|
||||
.setFooter({ text: guild.client.config.embed.footer });
|
||||
const channel = guild.channels.cache.get(guildData.plugins.modlogs);
|
||||
if (channel) channel.send(embed);
|
||||
|
||||
|
|
26
index.js
26
index.js
|
@ -20,11 +20,25 @@ if (config.apiKeys.sentryDSN) {
|
|||
};
|
||||
|
||||
// Load JaBa class
|
||||
const JaBa = require("./base/JaBa"),
|
||||
client = new JaBa();
|
||||
const JaBa = require("./base/JaBa");
|
||||
const client = new JaBa({
|
||||
intents: [
|
||||
Intents.FLAGS.GUILDS,
|
||||
Intents.FLAGS.GUILD_MEMBERS,
|
||||
Intents.FLAGS.GUILD_BANS,
|
||||
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
|
||||
Intents.FLAGS.GUILD_INVITES,
|
||||
Intents.FLAGS.GUILD_VOICE_STATES,
|
||||
Intents.FLAGS.GUILD_PRESENCES,
|
||||
Intents.FLAGS.GUILD_MESSAGES,
|
||||
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
|
||||
Intents.FLAGS.GUILD_MESSAGE_TYPING,
|
||||
Intents.FLAGS.DIRECT_MESSAGES,
|
||||
],
|
||||
partials: ["CHANNEL"]
|
||||
});
|
||||
|
||||
const init = async () => {
|
||||
// Search for all commands
|
||||
const directories = await readdir("./commands/");
|
||||
client.logger.log(`Loading a total of ${directories.length} categories.`, "log");
|
||||
directories.forEach(async (dir) => {
|
||||
|
@ -37,7 +51,6 @@ const init = async () => {
|
|||
});
|
||||
});
|
||||
|
||||
// Then we load events, which will include our message and ready event.
|
||||
const evtFiles = await readdir("./events/");
|
||||
client.logger.log(`Loading a total of ${evtFiles.length} events.`, "log");
|
||||
evtFiles.forEach((file) => {
|
||||
|
@ -48,9 +61,8 @@ const init = async () => {
|
|||
delete require.cache[require.resolve(`./events/${file}`)];
|
||||
});
|
||||
|
||||
client.login(client.config.token); // Log in to the discord api
|
||||
client.login(client.config.token);
|
||||
|
||||
// connect to mongoose database
|
||||
mongoose.connect(client.config.mongoDB, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true
|
||||
|
@ -69,11 +81,9 @@ const init = async () => {
|
|||
|
||||
init();
|
||||
|
||||
// if there are errors, log them
|
||||
client.on("disconnect", () => client.logger.log("Bot is disconnecting...", "warn"))
|
||||
.on("reconnecting", () => client.logger.log("Bot reconnecting...", "log"))
|
||||
.on("error", (e) => client.logger.log(e, "error"))
|
||||
.on("warn", (info) => client.logger.log(info, "warn"));
|
||||
|
||||
// if there is an unhandledRejection, log them
|
||||
process.on("unhandledRejection", (err) => console.error(err));
|
|
@ -17,7 +17,6 @@
|
|||
"SPECIAL_CHANNELS": "Special channels",
|
||||
"MODLOGS": "Moderation logs: *{{channel}}*",
|
||||
"BIRTHDAYS": "Birthdays announcements: *{{channel}}*",
|
||||
"FORTNITESHOP": "Fortnite daily shop: *{{channel}}*",
|
||||
"SUGGESTIONS": "Suggestions: *{{channel}}*",
|
||||
"REPORTS": "Reports: *{{channel}}*",
|
||||
"AUTOMOD_TITLE": "Auto-moderation:",
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Set the daily Fortnite shop channel!",
|
||||
"USAGE": "{{prefix}}setfortniteshop (#channel)",
|
||||
"EXAMPLES": "{{prefix}}setfortniteshop #shop\n{{prefix}}setfortniteshop",
|
||||
"DISABLED": "Daily Fortnite shop disabled!",
|
||||
"ENABLED": "Daily Fortnite shop enabled in {{channel}}!"
|
||||
}
|
|
@ -56,7 +56,6 @@
|
|||
"UPDATE": "Update",
|
||||
"SUGGESTIONS": "Suggestions",
|
||||
"MODLOGS": "Moderation logs",
|
||||
"FORTNITESHOP": "Fortnite shop",
|
||||
"NO_CHANNEL": "No channel",
|
||||
"REPORTS": "Reports",
|
||||
"BIRTHDAYS": "Birthdays",
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Shows a player's Fortnite stats!",
|
||||
"USAGE": "{{prefix}}fortnite [psn/xbl/pc] [pseudo]",
|
||||
"EXAMPLES": "{{prefix}}fortnite pc Ninja",
|
||||
"MISSING_PLATFORM": "Please specify a platform between `psn`, `pc` or `xbl`!",
|
||||
"MISSING_USERNAME": "Please enter a valid epic games username!",
|
||||
"NOT_FOUND": "`{{search}}` was not found on `{{platform}}`!",
|
||||
"TITLE": "{{username}} Fortnite Stats",
|
||||
"AVERAGE_KILLS": "KILLS/MATCH",
|
||||
"AVERAGE_KILL": "KILL/MATCH",
|
||||
"W_PERCENT": "W%",
|
||||
"WIN_PERCENT": "WIN%",
|
||||
"KD": "KD",
|
||||
"WINS": "Wins",
|
||||
"WIN": "Win",
|
||||
"MATCHES": "Matches",
|
||||
"MATCH": "Match",
|
||||
"KILLS": "Kills",
|
||||
"KILL": "Kill",
|
||||
"FOOTER": "By JaBa using fortnitetracker.com"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Shows the daily fortnite items shop!",
|
||||
"USAGE": "{{prefix}}fortniteshop",
|
||||
"EXAMPLES": "{{prefix}}fortniteshop",
|
||||
"HEADER": "FORTNITE ITEMS SHOP",
|
||||
"DAILY": "DAILY",
|
||||
"FEATURED": "FEATURED",
|
||||
"DATE": "{{date}} Fortnite shop",
|
||||
"FOOTER": "Fortnite Shop by JaBa"
|
||||
}
|
|
@ -17,7 +17,6 @@
|
|||
"SPECIAL_CHANNELS": "Специальные каналы",
|
||||
"MODLOGS": "Логи модерации: *{{channel}}*",
|
||||
"BIRTHDAYS": "Поздравления с днём рождения: *{{channel}}*",
|
||||
"FORTNITESHOP": "Ежедневный магазин Fortnite: *{{channel}}*",
|
||||
"SUGGESTIONS": "Предложения: *{{channel}}*",
|
||||
"REPORTS": "Жалобы: *{{channel}}*",
|
||||
"AUTOMOD_TITLE": "Автомодерация",
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Установить канал для ежедневного Fortnite магазина!",
|
||||
"USAGE": "{{prefix}}setfortniteshop (#канал)",
|
||||
"EXAMPLES": "{{prefix}}setfortniteshop #магазин\n{{prefix}}setfortniteshop",
|
||||
"ENABLED": "Ежедневный Fortnite магазин включён в {{channel}}!",
|
||||
"DISABLED": "Ежедневный Fortnite магазин отключён!"
|
||||
}
|
|
@ -56,7 +56,6 @@
|
|||
"UPDATE": "Обновить",
|
||||
"SUGGESTIONS": "Предложения",
|
||||
"MODLOGS": "Логи модерации",
|
||||
"FORTNITESHOP": "Магазин Fortnite",
|
||||
"NO_CHANNEL": "Канал не выбран",
|
||||
"REPORTS": "Жалобы",
|
||||
"BIRTHDAYS": "Поздравления с днём рождения",
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"BOT_USER": "Ботам не нужны деньги!",
|
||||
"YOURSELF": "Вы не можете заплатить самому себе!",
|
||||
"INVALID_AMOUNT": "Укажите сумму",
|
||||
"ENOUGH_MONEY": "У вас нет **{{amount}}**",
|
||||
"SUCCESS": "Вы отправили **{{amount}}** пользователю **{{username}}**!"
|
||||
"ENOUGH_MONEY": "У вас нет {{amount}}",
|
||||
"SUCCESS": "Вы отправили {{amount}} пользователю **{{username}}**!"
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
"NOT_ENOUGH_MEMBER": "Вы не можете ограбить **{{username}}**, потому что у него нет с собой столько кредитов!",
|
||||
"COOLDOWN": "🕵️ **{{username}}** под защитой.... Попробуйте позже!",
|
||||
"ROB_WON_1": "🎉 | Поздравляем! Полиция не смогла остановить вас, поэтому вы успешно украли **{{money}}** у **{{username}}**!",
|
||||
"ROB_WON_2": "😕 | **{{username}}**, вы ограбили **{{username}}** на **{{money}}**",
|
||||
"ROB_WON_2": "😕 | Вы ограбили **{{username}}** на **{{money}}**",
|
||||
"ROB_LOSE_1": "🚔 | Полиция поймала вас. Теперь вы должны заплатить **{{fine}}**. **{{offset}}** будет выплачено **{{username}}**.",
|
||||
"ROB_LOSE_2": "🚓 | Плохие новости... **{{username}}** вовремя позвонил в полицию. Вы должны заплатить **{{fine}}** и **{{offset}}** будет выплачено **{{username}}**."
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"DESCRIPTION": "Превратить текст в ASCII код!",
|
||||
"DESCRIPTION": "Превратить текст в ASCII код!\nПоддерживаются только английские буквы и цифры!",
|
||||
"USAGE": "{{prefix}}ascii [текст]",
|
||||
"EXAMPLES": "{{prefix}}ascii Hello world!",
|
||||
"TEXT_MISSING": "Введите текст (не больше 20 символов)!"
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Показать статистику игрока Fortnite!",
|
||||
"USAGE": "{{prefix}}fortnite [PSN/XBL/PC] [ник]",
|
||||
"EXAMPLES": "{{prefix}}fortnite PC Ninja",
|
||||
"MISSING_PLATFORM": "Выберите платформу: `PSN`, `PC` или `XBL` (без учёта регистра)!",
|
||||
"MISSING_USERNAME": "Укажите ник в Epic Games!",
|
||||
"NOT_FOUND": "`{{search}}` не найден на платформе `{{platform}}`!",
|
||||
"TITLE": "Статистика игрока {{username}}",
|
||||
"AVERAGE_KILLS": "Убийства/Матч",
|
||||
"AVERAGE_KILL": "Убийство/Матч",
|
||||
"W_PERCENT": "% Побед",
|
||||
"WIN_PERCENT": "% Побед",
|
||||
"KD": "КД",
|
||||
"WINS": "Побед(а/ы)",
|
||||
"WIN": "Победа",
|
||||
"MATCHES": "Матч(а/ей)",
|
||||
"MATCH": "Матч",
|
||||
"KILLS": "Убийств(о/а)",
|
||||
"KILL": "Убийство",
|
||||
"FOOTER": "JaBA | fortnitetracker.com"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Показать ежедневный магазин Fortnite!",
|
||||
"USAGE": "{{prefix}}fortniteshop",
|
||||
"EXAMPLES": "{{prefix}}fortniteshop",
|
||||
"HEADER": "Магазин предметов FORTNITE",
|
||||
"DAILY": "Ежедневное",
|
||||
"FEATURED": "Предлагаемые",
|
||||
"DATE": "Магазин от {{date}}",
|
||||
"FOOTER": "JaBa | Магазин Fortnite"
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"DESCRIPTION": "Проверить пользователей на наличие ссылок-приглашений в статусе!",
|
||||
"USAGE": "{{prefix}}checkinvites",
|
||||
"EXAMPLES": "{{prefix}}checkinvites",
|
||||
"NOBODY": "Ни у кого нет ссылок-приглашений в статусе!"
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
"T_TITLE": "Название",
|
||||
"T_CHANNEL": "Канал",
|
||||
"T_DURATION": "Длительность",
|
||||
"T_CONF": "Настройки",
|
||||
"T_DESCRIPTION": "Описание",
|
||||
"NO_DESCRIPTION": "Описание отсутствует"
|
||||
}
|
|
@ -3,5 +3,5 @@
|
|||
"USAGE": "{{prefix}}reload",
|
||||
"EXAMPLES": "{{prefix}}reload help",
|
||||
"NOT_FOUND": "Команды `{{search}}` не существует!",
|
||||
"SUCCESS": "Команда успешно перезагружена!"
|
||||
"SUCCESS": "Команда `{{command}}` успешно перезагружена!"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jaba",
|
||||
"version": "3.1.6",
|
||||
"version": "3.2",
|
||||
"description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
|
@ -32,7 +32,7 @@
|
|||
"discord-backup": "^2.1.19",
|
||||
"discord-canvas": "^1.3.2",
|
||||
"discord-giveaways": "^4.4.3",
|
||||
"discord-paginationembed": "^2.1.0",
|
||||
"discord-paginationembed": "github:gazmull/discord-paginationembed#v3",
|
||||
"discord-tictactoe": "^2.2.0",
|
||||
"discord-together": "^1.3.25",
|
||||
"discord.js": "^12.5.3",
|
||||
|
@ -42,7 +42,6 @@
|
|||
"express-session": "^1.17.0",
|
||||
"ffmpeg-static": "^4.4.0",
|
||||
"figlet": "^1.5.0",
|
||||
"fortnite": "^4.3.2",
|
||||
"gamedig": "^3.0.0",
|
||||
"i18next": "^20.2.2",
|
||||
"i18next-node-fs-backend": "^2.1.3",
|
||||
|
|
|
@ -112,21 +112,6 @@ const checks = [
|
|||
success("Valid DBL key");
|
||||
};
|
||||
};
|
||||
if (!config.apiKeys.fortniteFNBR) {
|
||||
ignore("fortniteFNBR API is not configured, key should not be checked.");
|
||||
} else {
|
||||
const res = await fetch("https://fnbr.co/api/stats", {
|
||||
headers: {
|
||||
"x-api-key": config.apiKeys.fortniteFNBR
|
||||
}
|
||||
});
|
||||
const result = await res.json();
|
||||
if (result.status && result.status === 401) {
|
||||
error("Should be a valid FNBR key", "get your key here: https://fnbr.co/api/docs");
|
||||
} else {
|
||||
success("Valid FNBR key");
|
||||
};
|
||||
};
|
||||
if (!config.apiKeys.sentryDSN) {
|
||||
ignore("SentryDSN is not configured, key should not be checked.");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue