mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-24 22:24:58 +05:00
v4.1
Фолбек если у трека нет изображения Фикс skip Фикс marry Замена способа ввода даты рождения в birthdate
This commit is contained in:
parent
b1aaf966b4
commit
a9588b4118
26 changed files with 157 additions and 73 deletions
|
@ -72,7 +72,7 @@ class JaBa extends Client {
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (m.deletable) m.delete();
|
if (m.deletable) m.delete();
|
||||||
}, 10 * 60 * 1000); // m * s * ms
|
}, (10 * 60 * 1000)); // m * s * ms
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on("queueEnd", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language)))
|
.on("queueEnd", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language)))
|
||||||
|
|
|
@ -11,8 +11,28 @@ class Birthdate extends BaseCommand {
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
.setName("birthdate")
|
.setName("birthdate")
|
||||||
.setDescription(client.translate("economy/birthdate:DESCRIPTION"))
|
.setDescription(client.translate("economy/birthdate:DESCRIPTION"))
|
||||||
.addStringOption(option => option.setName("date")
|
.addIntegerOption(option => option.setName("day")
|
||||||
.setDescription(client.translate("economy/birthdate:DATE"))
|
.setDescription(client.translate("economy/birthdate:DAY"))
|
||||||
|
.setRequired(true))
|
||||||
|
.addIntegerOption(option => option.setName("month")
|
||||||
|
.setDescription(client.translate("economy/birthdate:MONTH"))
|
||||||
|
.setRequired(true)
|
||||||
|
.addChoices(
|
||||||
|
{ name: "Январь", value: 1 },
|
||||||
|
{ name: "Февраль", value: 2 },
|
||||||
|
{ name: "Март", value: 3 },
|
||||||
|
{ name: "Апрель", value: 4 },
|
||||||
|
{ name: "Май", value: 5 },
|
||||||
|
{ name: "Июнь", value: 6 },
|
||||||
|
{ name: "Июль", value: 7 },
|
||||||
|
{ name: "Август", value: 8 },
|
||||||
|
{ name: "Сентябрь", value: 9 },
|
||||||
|
{ name: "Октябрь", value: 10 },
|
||||||
|
{ name: "Ноябрь", value: 11 },
|
||||||
|
{ name: "Декабрь", value: 12 }
|
||||||
|
))
|
||||||
|
.addIntegerOption(option => option.setName("year")
|
||||||
|
.setDescription(client.translate("economy/birthdate:YEAR"))
|
||||||
.setRequired(true)),
|
.setRequired(true)),
|
||||||
aliases: [],
|
aliases: [],
|
||||||
dirname: __dirname,
|
dirname: __dirname,
|
||||||
|
@ -34,11 +54,9 @@ class Birthdate extends BaseCommand {
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
*/
|
*/
|
||||||
async execute(client, interaction, data) {
|
async execute(client, interaction, data) {
|
||||||
const date = interaction.options.getString("date");
|
const day = interaction.options.getInteger("day");
|
||||||
const match = date.match(/\d+/g);
|
const month = interaction.options.getInteger("month");
|
||||||
if (!match) return interaction.error("economy/birthdate:INVALID_DATE");
|
const year = interaction.options.getInteger("year");
|
||||||
const [day, month, year] = date.split("/");
|
|
||||||
if (!day || !month || !year) return interaction.error("economy/birthdate:INVALID_DATE");
|
|
||||||
|
|
||||||
const d = new Date(year, month - 1, day);
|
const d = new Date(year, month - 1, day);
|
||||||
if (!(day == d.getDate() && month - 1 == d.getMonth() && year == d.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE");
|
if (!(day == d.getDate() && month - 1 == d.getMonth() && year == d.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE");
|
||||||
|
|
|
@ -79,14 +79,13 @@ class Marry extends BaseCommand {
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId("marry_confirm_yes")
|
.setCustomId("marry_confirm_yes")
|
||||||
.setLabel(interaction.translate("common:ACCEPT"))
|
.setLabel(interaction.translate("common:ACCEPT"))
|
||||||
.setStyle(ButtonStyle.Danger),
|
.setStyle(ButtonStyle.Success),
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId("marry_confirm_no")
|
.setCustomId("marry_confirm_no")
|
||||||
.setLabel(interaction.translate("common:CANCEL"))
|
.setLabel(interaction.translate("common:CANCEL"))
|
||||||
.setStyle(ButtonStyle.Secondary),
|
.setStyle(ButtonStyle.Danger),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: interaction.translate("economy/marry:REQUEST", {
|
content: interaction.translate("economy/marry:REQUEST", {
|
||||||
to: member.toString(),
|
to: member.toString(),
|
||||||
|
@ -96,7 +95,7 @@ class Marry extends BaseCommand {
|
||||||
});
|
});
|
||||||
|
|
||||||
const filter = i => i.user.id === member.id;
|
const filter = i => i.user.id === member.id;
|
||||||
const collector = interaction.channel.createMessageComponentCollector({ filter, time: 120000 });
|
const collector = interaction.channel.createMessageComponentCollector({ filter, time: (10 * 60 * 1000) });
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
if (i.isButton()) {
|
if (i.isButton()) {
|
||||||
|
@ -107,7 +106,25 @@ class Marry extends BaseCommand {
|
||||||
|
|
||||||
collector.on("end", async (_, reason) => {
|
collector.on("end", async (_, reason) => {
|
||||||
delete pendings[interaction.member.id];
|
delete pendings[interaction.member.id];
|
||||||
if (reason === "time") return interaction.error("economy/marry:TIMEOUT");
|
if (reason === "time") {
|
||||||
|
const row = new ActionRowBuilder()
|
||||||
|
.addComponents(
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId("marry_confirm_yes")
|
||||||
|
.setLabel(interaction.translate("common:ACCEPT"))
|
||||||
|
.setStyle(ButtonStyle.Success)
|
||||||
|
.setDisabled(true),
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId("marry_confirm_no")
|
||||||
|
.setLabel(interaction.translate("common:CANCEL"))
|
||||||
|
.setStyle(ButtonStyle.Danger)
|
||||||
|
.setDisabled(true),
|
||||||
|
);
|
||||||
|
return interaction.editReply({
|
||||||
|
components: [row]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (reason) {
|
if (reason) {
|
||||||
data.userData.lover = member.id;
|
data.userData.lover = member.id;
|
||||||
await data.userData.save();
|
await data.userData.save();
|
||||||
|
@ -131,6 +148,7 @@ class Marry extends BaseCommand {
|
||||||
userData.markModified("achievements.married");
|
userData.markModified("achievements.married");
|
||||||
await userData.save();
|
await userData.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.userData.achievements.married.achieved) {
|
if (!data.userData.achievements.married.achieved) {
|
||||||
if (!sent) interaction.followUp(messageOptions);
|
if (!sent) interaction.followUp(messageOptions);
|
||||||
data.userData.achievements.married.achieved = true;
|
data.userData.achievements.married.achieved = true;
|
||||||
|
@ -139,14 +157,20 @@ class Marry extends BaseCommand {
|
||||||
await data.userData.save();
|
await data.userData.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return interaction.success("economy/marry:SUCCESS", {
|
return interaction.editReply({
|
||||||
|
content: interaction.translate("economy/marry:SUCCESS", {
|
||||||
creator: interaction.member.toString(),
|
creator: interaction.member.toString(),
|
||||||
partner: member.toString()
|
partner: member.toString()
|
||||||
|
}),
|
||||||
|
components: []
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return interaction.success("economy/marry:DENIED", {
|
return interaction.editReply({
|
||||||
|
content: interaction.translate("economy/marry:DENIED", {
|
||||||
creator: interaction.member.toString(),
|
creator: interaction.member.toString(),
|
||||||
partner: member.toString()
|
partner: member.toString()
|
||||||
|
}),
|
||||||
|
components: []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -105,7 +105,7 @@ class Number extends BaseCommand {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("end", (_collected, reason) => {
|
collector.on("end", (_, reason) => {
|
||||||
delete currentGames[interaction.guildId];
|
delete currentGames[interaction.guildId];
|
||||||
if (reason === "time") return interaction.editReply({ content: interaction.translate("economy/number:DEFEAT", { number }) });
|
if (reason === "time") return interaction.editReply({ content: interaction.translate("economy/number:DEFEAT", { number }) });
|
||||||
else if (reason === "force") return interaction.editReply({ content: interaction.translate("misc:FORCE_STOP", { user: interaction.member.toString() }) });
|
else if (reason === "force") return interaction.editReply({ content: interaction.translate("misc:FORCE_STOP", { user: interaction.member.toString() }) });
|
||||||
|
|
|
@ -37,9 +37,9 @@ class Work extends BaseCommand {
|
||||||
time: client.convertTime(isInCooldown, true, true)
|
time: client.convertTime(isInCooldown, true, true)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (Date.now() > data.memberData.cooldowns.work + (24 * 3600000)) data.memberData.workStreak = 0;
|
if (Date.now() > data.memberData.cooldowns.work + (24 * 60 * 60 * 1000)) data.memberData.workStreak = 0;
|
||||||
|
|
||||||
const toWait = Date.now() + 43200000; // 24 hours
|
const toWait = Date.now() + (24 * 60 * 60 * 1000); // 24 hours
|
||||||
data.memberData.cooldowns.work = toWait;
|
data.memberData.cooldowns.work = toWait;
|
||||||
data.memberData.markModified("cooldowns");
|
data.memberData.markModified("cooldowns");
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Memes extends BaseCommand {
|
||||||
filter,
|
filter,
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 30 * 1000
|
idle: (60 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
|
@ -78,6 +78,14 @@ class Memes extends BaseCommand {
|
||||||
embeds: [embed]
|
embeds: [embed]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Activity extends BaseCommand {
|
||||||
filter,
|
filter,
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 30 * 1000
|
idle: (2 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
|
@ -85,6 +85,14 @@ class Activity extends BaseCommand {
|
||||||
components: []
|
components: []
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Help extends BaseCommand {
|
||||||
const collector = new InteractionCollector(client, {
|
const collector = new InteractionCollector(client, {
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 60 * 1000
|
idle: (2 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async msg => {
|
collector.on("collect", async msg => {
|
||||||
|
@ -115,6 +115,14 @@ class Help extends BaseCommand {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Clips extends BaseCommand {
|
||||||
filter,
|
filter,
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 30 * 1000
|
idle: (2 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
|
@ -106,6 +106,14 @@ class Clips extends BaseCommand {
|
||||||
components: []
|
components: []
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class Loop extends BaseCommand {
|
||||||
const collector = new InteractionCollector(client, {
|
const collector = new InteractionCollector(client, {
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 60 * 1000
|
idle: (2 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
|
@ -90,6 +90,14 @@ class Loop extends BaseCommand {
|
||||||
components: []
|
components: []
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Nowplaying extends BaseCommand {
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.translate("music/queue:TITLE")
|
name: interaction.translate("music/queue:TITLE")
|
||||||
})
|
})
|
||||||
.setThumbnail(track.thumbnail)
|
.setThumbnail(track.thumbnail || "https://cdn.discordapp.com/attachments/708642702602010684/1012418217660121089/noimage.png")
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: interaction.translate("music/nowplaying:T_TITLE"),
|
name: interaction.translate("music/nowplaying:T_TITLE"),
|
||||||
|
|
|
@ -36,25 +36,26 @@ class Skip extends BaseCommand {
|
||||||
const queue = client.player.getQueue(interaction.guildId);
|
const queue = client.player.getQueue(interaction.guildId);
|
||||||
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
||||||
|
|
||||||
|
const skipped = queue.skip();
|
||||||
|
if (skipped) {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.translate("music/skip:SUCCESS")
|
name: interaction.translate("music/skip:SUCCESS")
|
||||||
})
|
})
|
||||||
.setThumbnail(queue.tracks[1].thumbnail || null)
|
.setThumbnail(queue.current.thumbnail || null)
|
||||||
.setDescription(interaction.translate("music/play:NOW_PLAYING", {
|
.setDescription(interaction.translate("music/play:NOW_PLAYING", {
|
||||||
songName: queue.tracks[1].title
|
songName: queue.current.title
|
||||||
}))
|
}))
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: client.config.embed.footer
|
text: client.config.embed.footer
|
||||||
})
|
})
|
||||||
.setColor(client.config.embed.color);
|
.setColor(client.config.embed.color);
|
||||||
|
|
||||||
queue.skip();
|
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [embed]
|
embeds: [embed]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Skip;
|
module.exports = Skip;
|
|
@ -61,7 +61,7 @@ class NSFW extends BaseCommand {
|
||||||
filter,
|
filter,
|
||||||
componentType: ComponentType.SelectMenu,
|
componentType: ComponentType.SelectMenu,
|
||||||
message: msg,
|
message: msg,
|
||||||
idle: 60 * 1000
|
idle: (60 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
|
@ -81,6 +81,14 @@ class NSFW extends BaseCommand {
|
||||||
embeds: [embed]
|
embeds: [embed]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
collector.on("end", (_, reason) => {
|
||||||
|
if (reason === "idle") {
|
||||||
|
if (msg) msg.update({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Servers extends BaseCommand {
|
||||||
await msg.react("❌");
|
await msg.react("❌");
|
||||||
|
|
||||||
const collector = msg.createReactionCollector({
|
const collector = msg.createReactionCollector({
|
||||||
time: 60 * 1000
|
time: (2 * 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async reaction => {
|
collector.on("collect", async reaction => {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class GuildCreate extends BaseEvent {
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: "Спасибо что добавили меня на свой сервер!"
|
name: "Спасибо что добавили меня на свой сервер!"
|
||||||
})
|
})
|
||||||
.setDescription("Чтобы получить список команд использууйуте `/help` и посмотрите на административные команды!.")
|
.setDescription("Чтобы получить список команд, используйте `/help`!.")
|
||||||
.setColor(client.config.embed.color)
|
.setColor(client.config.embed.color)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: client.config.embed.footer
|
text: client.config.embed.footer
|
||||||
|
@ -47,8 +47,8 @@ class GuildCreate extends BaseEvent {
|
||||||
const owner = await guild.fetchOwner();
|
const owner = await guild.fetchOwner();
|
||||||
owner.send(messageOptions);
|
owner.send(messageOptions);
|
||||||
|
|
||||||
const users = guild.members.cache.filter((m) => !m.user.bot).size;
|
const users = guild.members.cache.filter(m => !m.user.bot).size;
|
||||||
const bots = guild.members.cache.filter((m) => m.user.bot).size;
|
const bots = guild.members.cache.filter(m => m.user.bot).size;
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
|
|
|
@ -3,7 +3,6 @@ const Canvas = require("canvas"),
|
||||||
{ AttachmentBuilder } = require("discord.js"),
|
{ AttachmentBuilder } = require("discord.js"),
|
||||||
{ resolve } = require("path");
|
{ resolve } = require("path");
|
||||||
|
|
||||||
// Register assets fonts
|
|
||||||
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
|
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
|
||||||
Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "KeepCalm" });
|
Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "KeepCalm" });
|
||||||
|
|
||||||
|
@ -53,10 +52,8 @@ class GuildMemberAdd extends BaseEvent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the autorole is enabled
|
|
||||||
if (guildData.plugins.autorole.enabled) member.roles.add(guildData.plugins.autorole.role);
|
if (guildData.plugins.autorole.enabled) member.roles.add(guildData.plugins.autorole.role);
|
||||||
|
|
||||||
// Check if welcome message is enabled
|
|
||||||
if (guildData.plugins.welcome.enabled) {
|
if (guildData.plugins.welcome.enabled) {
|
||||||
const channel = member.guild.channels.cache.get(guildData.plugins.welcome.channel);
|
const channel = member.guild.channels.cache.get(guildData.plugins.welcome.channel);
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
@ -134,8 +131,7 @@ class GuildMemberAdd extends BaseEvent {
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
const avatar = await Canvas.loadImage(member.displayAvatarURL({
|
const avatar = await Canvas.loadImage(member.displayAvatarURL({
|
||||||
extension: "jpg",
|
extension: "jpg"
|
||||||
size: 512
|
|
||||||
}));
|
}));
|
||||||
ctx.drawImage(avatar, 45, 90, 270, 270);
|
ctx.drawImage(avatar, 45, 90, 270, 270);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ const Canvas = require("canvas"),
|
||||||
{ AttachmentBuilder } = require("discord.js"),
|
{ AttachmentBuilder } = require("discord.js"),
|
||||||
{ resolve } = require("path");
|
{ resolve } = require("path");
|
||||||
|
|
||||||
// Register assets fonts
|
|
||||||
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
|
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
|
||||||
Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "KeepCalm" });
|
Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "KeepCalm" });
|
||||||
|
|
||||||
|
@ -39,7 +38,6 @@ class GuildMemberRemove extends BaseEvent {
|
||||||
});
|
});
|
||||||
member.guild.data = guildData;
|
member.guild.data = guildData;
|
||||||
|
|
||||||
// Check if goodbye message is enabled
|
|
||||||
if (guildData.plugins.goodbye.enabled) {
|
if (guildData.plugins.goodbye.enabled) {
|
||||||
const channel = member.guild.channels.cache.get(guildData.plugins.goodbye.channel);
|
const channel = member.guild.channels.cache.get(guildData.plugins.goodbye.channel);
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
|
|
@ -17,9 +17,9 @@ class GuildMemberUpdate extends BaseEvent {
|
||||||
async execute(client, oldMember, newMember) {
|
async execute(client, oldMember, newMember) {
|
||||||
if (oldMember.guild && oldMember.guild.id === "568120814776614924") return;
|
if (oldMember.guild && oldMember.guild.id === "568120814776614924") return;
|
||||||
if (oldMember.guild.id !== client.config.support.id) return;
|
if (oldMember.guild.id !== client.config.support.id) return;
|
||||||
if (oldMember.roles.cache.some((r) => r.name === "Поддержавшие JaBa")) return;
|
if (oldMember.roles.cache.some(r => r.name === "Поддержавшие JaBa")) return;
|
||||||
|
|
||||||
if (newMember?.roles.cache.some((r) => r.name === "Поддержавшие JaBa")) {
|
if (newMember?.roles.cache.some(r => r.name === "Поддержавшие JaBa")) {
|
||||||
const userData = await client.findOrCreateUser({
|
const userData = await client.findOrCreateUser({
|
||||||
id: newMember.id
|
id: newMember.id
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,7 @@ const { EmbedBuilder } = require("discord.js");
|
||||||
module.exports.init = function (client) {
|
module.exports.init = function (client) {
|
||||||
client.usersData
|
client.usersData
|
||||||
.find({ reminds: { $gt: [] } })
|
.find({ reminds: { $gt: [] } })
|
||||||
.then((users) => {
|
.then(users => {
|
||||||
for (const user of users) {
|
for (const user of users) {
|
||||||
if (!client.users.cache.has(user.id)) client.users.fetch(user.id);
|
if (!client.users.cache.has(user.id)) client.users.fetch(user.id);
|
||||||
client.databaseCache.usersReminds.set(user.id, user);
|
client.databaseCache.usersReminds.set(user.id, user);
|
||||||
|
|
|
@ -3,7 +3,7 @@ const { EmbedBuilder } = require("discord.js");
|
||||||
module.exports.init = async function (client) {
|
module.exports.init = async function (client) {
|
||||||
client.membersData
|
client.membersData
|
||||||
.find({ "mute.muted": true })
|
.find({ "mute.muted": true })
|
||||||
.then((members) => {
|
.then(members => {
|
||||||
members.forEach((member) => client.databaseCache.mutedUsers.set(`${member.id}${member.guildID}`, member));
|
members.forEach((member) => client.databaseCache.mutedUsers.set(`${member.id}${member.guildID}`, member));
|
||||||
});
|
});
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
module.exports.init = async function (client) {
|
module.exports.init = async function (client) {
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
// Date.now() + days * hours * mins * secs * msecs / 1 month
|
const timestamp = Date.now() + (30 * 24 * 60 * 60 * 1000); // 1 month
|
||||||
const timestamp = Date.now() + 30 * 24 * 60 * 60 * 1000;
|
|
||||||
const members = client.membersData.find({ transactions: { $gt: [] } });
|
const members = client.membersData.find({ transactions: { $gt: [] } });
|
||||||
|
|
||||||
for (const member of members) {
|
for (const member of members) {
|
||||||
|
@ -14,5 +13,5 @@ module.exports.init = async function (client) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 7 * 24 * 60 * 60 * 1000); // every 7 days
|
}, (7 * 24 * 60 * 60 * 1000)); // every 7 days
|
||||||
};
|
};
|
|
@ -835,7 +835,7 @@ async function tictactoe(interaction, options = {}) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("end", (collected, reason) => {
|
collector.on("end", (_, reason) => {
|
||||||
if (reason == "time") {
|
if (reason == "time") {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(interaction.translate("economy/tictactoe:NO_ANSWER_TITLE"))
|
.setTitle(interaction.translate("economy/tictactoe:NO_ANSWER_TITLE"))
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
"DESCRIPTION": "Установить дату рождения",
|
"DESCRIPTION": "Установить дату рождения",
|
||||||
"USAGE": "[ДД/ММ/ГГГГ]",
|
"USAGE": "[ДД] [ММ] [ГГГГ]",
|
||||||
"EXAMPLES": "birthdate 17/03/2002",
|
"EXAMPLES": "birthdate 17 03 2002",
|
||||||
"DATE": "Дата в формате ДД/ММ/ГГГГ (Например: 17/03/2002)",
|
"DAY": "День",
|
||||||
"INVALID_DATE": "Используйте данный формат: ДД/ММ/ГГГГ. Например: `17 марта 2002` будет `17/03/2002`.",
|
"MONTH": "Месяц",
|
||||||
|
"YEAR": "Год",
|
||||||
"DATE_TOO_LOW": "Вам больше 80 лет? :eyes:",
|
"DATE_TOO_LOW": "Вам больше 80 лет? :eyes:",
|
||||||
"DATE_TOO_HIGH": "Хммм... Вы ещё не родились!",
|
"DATE_TOO_HIGH": "Хммм... Вы ещё не родились!",
|
||||||
"HAPPY_BIRTHDAY": "День рождения",
|
"HAPPY_BIRTHDAY": "День рождения",
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"REQUEST_AMEMBER_TO_MEMBER": "{{secondUser}} уже отправил(а) предложение {{firstUser}}!",
|
"REQUEST_AMEMBER_TO_MEMBER": "{{secondUser}} уже отправил(а) предложение {{firstUser}}!",
|
||||||
"REQUEST_MEMBER_TO_AMEMBER": "{{firstUser}} уже отправил(а) предложение {{secondUser}}! Подождите пока {{secondUser}} согласиться или откажет на предложение {{firstUser}} (либо дождитесь истечения срока предложения)!",
|
"REQUEST_MEMBER_TO_AMEMBER": "{{firstUser}} уже отправил(а) предложение {{secondUser}}! Подождите пока {{secondUser}} согласиться или откажет на предложение {{firstUser}} (либо дождитесь истечения срока предложения)!",
|
||||||
"REQUEST": "{{to}}, вы согласны вступить в брак с {{from}}?",
|
"REQUEST": "{{to}}, вы согласны вступить в брак с {{from}}?",
|
||||||
"TIMEOUT": "Время на ответ вышло, попробуйте ещё раз!",
|
|
||||||
"DENIED": "{{creator}}, у меня есть плохие новости... {{partner}} отказался(лась) от вашего предложение.",
|
"DENIED": "{{creator}}, у меня есть плохие новости... {{partner}} отказался(лась) от вашего предложение.",
|
||||||
"SUCCESS": "🎉 Поздравляем! **{{creator}}** и **{{partner}}** теперь состоят в браке!",
|
"SUCCESS": "🎉 Поздравляем! **{{creator}}** и **{{partner}}** теперь состоят в браке!",
|
||||||
"BOT_USER": "Боты вечно одиноки ;("
|
"BOT_USER": "Боты вечно одиноки ;("
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.0",
|
"version": "4.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.0",
|
"version": "4.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "^3.0.2",
|
"@discord-player/extractor": "^3.0.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.0",
|
"version": "4.1",
|
||||||
"description": "My Discord Bot",
|
"description": "My Discord Bot",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
Loading…
Reference in a new issue