This commit is contained in:
Jonny_Bro (Nikita) 2023-09-25 21:42:43 +05:00
parent ceb2aebc5e
commit be634fa563
46 changed files with 134 additions and 166 deletions

22
.gitignore vendored
View file

@ -1,33 +1,17 @@
# Mac OS files
.DS_Store
# Bot Configuration # Bot Configuration
/config.js /config.js
# DB # DB
/giveaways.json /giveaways.json
# commands.md
**/commands.md
# Data
/.data
# Clips # Clips
/clips /clips
# Mac OS files
.DS_Store
# IDE
.vscode
# Node # Node
node_modules node_modules
# SQlite # SQlite
/json.sqlite /json.sqlite
# Sessions Store
sessions
# SSL
/*.crt
/*.key

View file

@ -1,41 +0,0 @@
const { EmbedBuilder } = require("discord.js"),
BaseEvent = require("../../base/BaseEvent");
class messageDelete extends BaseEvent {
constructor() {
super({
name: "messageDelete",
once: false,
});
}
/**
*
* @param {import("../../base/JaBa")} client The Discord Client
* @param {import("discord.js").GuildMember} member The member that has joined a guild
*/
async execute(client, message) {
if (message.guild && message.guildId === "568120814776614924") return;
if (message.author.bot) return;
const guildData = await client.findOrCreateGuild({ id: message.guildId });
if (guildData.plugins?.monitoring?.messageDelete) {
const embed = new EmbedBuilder()
.setAuthor({
name: message.author.getUsername(),
iconURL: message.author.displayAvatarURL(),
})
.setColor(client.config.embed.color)
.setFooter(client.config.embed.footer)
.setTitle(`${message.author.getUsername()} deleted a message!`)
.setDescription(`Message content was: \`\`\`${message.content}\`\`\``);
message.guild.channels.cache.get(guildData.plugins.monitoring.messageDelete).send({
embeds: [embed],
});
}
}
}
module.exports = messageDelete;

View file

@ -1,41 +0,0 @@
const { EmbedBuilder } = require("discord.js"),
BaseEvent = require("../../base/BaseEvent");
class messageDelete extends BaseEvent {
constructor() {
super({
name: "messageDelete",
once: false,
});
}
/**
*
* @param {import("../../base/JaBa")} client The Discord Client
* @param {import("discord.js").GuildMember} member The member that has left/been kicked from the guild
*/
async execute(client, member) {
if (message.guild && message.guildId === "568120814776614924") return;
if (message.author.bot) return;
const guildData = await client.findOrCreateGuild({ id: message.guildId });
if (guildData.plugins?.monitoring?.messageDelete) {
const embed = new EmbedBuilder()
.setAuthor({
name: message.author.getUsername(),
iconURL: message.author.displayAvatarURL(),
})
.setColor(client.config.embed.color)
.setFooter(client.config.embed.footer)
.setTitle(`${message.author.getUsername()} deleted a message!`)
.setDescription(`Message content was: \`\`\`${message.content}\`\`\``);
message.guild.channels.cache.get(guildData.plugins.monitoring.messageDelete).send({
embeds: [embed],
});
}
}
}
module.exports = messageDelete;

View file

@ -1,42 +0,0 @@
// const { EmbedBuilder } = require("discord.js"),
// BaseEvent = require("../../base/BaseEvent");
// class messageDelete extends BaseEvent {
// constructor() {
// super({
// name: "messageDelete",
// once: false,
// });
// }
// /**
// *
// * @param {import("../../base/JaBa")} client The Discord Client
// * @param {import("discord.js").GuildMember} oldMember The member before the update
// * @param {import("discord.js").GuildMember} newMember The member after the update
// */
// async execute(client, oldMember, newMember) {
// if (oldMember.guild && oldMember.guild.id === "568120814776614924") return;
// if (oldMember.user.bot) return;
// const guildData = await client.findOrCreateGuild({ id: oldMember.guild.id });
// if (guildData.plugins?.monitoring?.messageDelete) {
// const embed = new EmbedBuilder()
// .setAuthor({
// name: message.author.getUsername(),
// iconURL: message.author.displayAvatarURL(),
// })
// .setColor(client.config.embed.color)
// .setFooter(client.config.embed.footer)
// .setTitle(`${message.author.getUsername()} deleted a message!`)
// .setDescription(`Message content was: \`\`\`${message.content}\`\`\``);
// message.guild.channels.cache.get(guildData.plugins.monitoring.messageDelete).send({
// embeds: [embed],
// });
// }
// }
// }
// module.exports = messageDelete;

View file

@ -37,9 +37,6 @@ module.exports = mongoose.model("Guild", new Schema({
ban: null, ban: null,
}, },
monitoring: { monitoring: {
memberAdd: null,
memberRemove: null,
memberUpdate: null,
messageUpdate: null, messageUpdate: null,
messageDelete: null, messageDelete: null,
}, },

View file

@ -281,8 +281,8 @@ class JaBa extends Client {
if (guildData) { if (guildData) {
guildData.members.push(memberData._id); guildData.members.push(memberData._id);
guildData.markModified("members");
guildData.markModified("members");
await guildData.save(); await guildData.save();
} }

View file

@ -38,6 +38,7 @@ class ImportMee6 extends BaseCommand {
const level = (await Mee6Api.getUserXp(interaction.guildId, interaction.member)).level; const level = (await Mee6Api.getUserXp(interaction.guildId, interaction.member)).level;
data.memberData.level = level; data.memberData.level = level;
data.markModified("memberData.level"); data.markModified("memberData.level");
await data.memberData.save(); await data.memberData.save();

View file

@ -64,6 +64,7 @@ class Automod extends BaseCommand {
enabled: true, enabled: true,
ignored: [], ignored: [],
}; };
data.guildData.markModified("plugins.automod"); data.guildData.markModified("plugins.automod");
await data.guildData.save(); await data.guildData.save();
@ -71,6 +72,7 @@ class Automod extends BaseCommand {
} else { } else {
if (channel) { if (channel) {
data.guildData.plugins.automod.ignored.push(channel.id); data.guildData.plugins.automod.ignored.push(channel.id);
data.guildData.markModified("plugins.automod"); data.guildData.markModified("plugins.automod");
await data.guildData.save(); await data.guildData.save();
@ -82,6 +84,7 @@ class Automod extends BaseCommand {
enabled: false, enabled: false,
ignored: [], ignored: [],
}; };
data.guildData.markModified("plugins.automod"); data.guildData.markModified("plugins.automod");
await data.guildData.save(); await data.guildData.save();

View file

@ -65,6 +65,7 @@ class Autorole extends BaseCommand {
enabled: true, enabled: true,
role: role.id, role: role.id,
}; };
data.guildData.markModified("plugins.autorole"); data.guildData.markModified("plugins.autorole");
await data.guildData.save(); await data.guildData.save();
@ -76,6 +77,7 @@ class Autorole extends BaseCommand {
enabled: false, enabled: false,
role: null, role: null,
}; };
data.guildData.markModified("plugins.autorole"); data.guildData.markModified("plugins.autorole");
await data.guildData.save(); await data.guildData.save();

View file

@ -51,6 +51,7 @@ class Config extends BaseCommand {
{ name: client.translate("administration/config:TICKETLOGS"), value: "tickets.ticketLogs" }, { name: client.translate("administration/config:TICKETLOGS"), value: "tickets.ticketLogs" },
{ name: client.translate("administration/config:TRANSCRIPTIONLOGS"), value: "tickets.transcriptionLogs" }, { name: client.translate("administration/config:TRANSCRIPTIONLOGS"), value: "tickets.transcriptionLogs" },
{ name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" }, { name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" },
{ name: client.translate("administration/config:MESSAGEDELETE"), value: "monitoring.messageDelete" },
) )
.setRequired(true), .setRequired(true),
) )
@ -151,7 +152,8 @@ class Config extends BaseCommand {
{ {
name: interaction.translate("administration/config:MONITORING_CHANNELS"), name: interaction.translate("administration/config:MONITORING_CHANNELS"),
value: value:
`${interaction.translate("administration/config:MESSAGEUPDATE")}: ${guildData.plugins?.monitoring?.messageUpdate ? `<#${guildData.plugins?.monitoring?.messageUpdate}>` : `*${interaction.translate("common:NOT_DEFINED")}*`}\n`, `${interaction.translate("administration/config:MESSAGEUPDATE")}: ${guildData.plugins?.monitoring?.messageUpdate ? `<#${guildData.plugins?.monitoring?.messageUpdate}>` : `*${interaction.translate("common:NOT_DEFINED")}*`}\n` +
`${interaction.translate("administration/config:MESSAGEDELETE")}: ${guildData.plugins?.monitoring?.messageDelete ? `<#${guildData.plugins?.monitoring?.messageDelete}>` : `*${interaction.translate("common:NOT_DEFINED")}*`}\n`,
}, },
{ {
name: interaction.translate("administration/config:SPECIAL_CHANNELS"), name: interaction.translate("administration/config:SPECIAL_CHANNELS"),
@ -200,6 +202,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) {
if (!state) { if (!state) {
guildData.plugins[settingSplitted[0]][settingSplitted[1]] = null; guildData.plugins[settingSplitted[0]][settingSplitted[1]] = null;
guildData.markModified("plugins"); guildData.markModified("plugins");
await guildData.save(); await guildData.save();
@ -212,6 +215,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) {
if (channel) { if (channel) {
guildData.plugins[settingSplitted[0]][settingSplitted[1]] = channel.id; guildData.plugins[settingSplitted[0]][settingSplitted[1]] = channel.id;
guildData.markModified("plugins"); guildData.markModified("plugins");
await guildData.save(); await guildData.save();

View file

@ -107,6 +107,7 @@ class Goodbye extends BaseCommand {
channelID: null, channelID: null,
withImage: null, withImage: null,
}; };
data.guildData.markModified("plugins.goodbye"); data.guildData.markModified("plugins.goodbye");
await data.guildData.save(); await data.guildData.save();
@ -122,6 +123,7 @@ class Goodbye extends BaseCommand {
message: message, message: message,
withImage: image, withImage: image,
}; };
data.guildData.markModified("plugins.goodbye"); data.guildData.markModified("plugins.goodbye");
await data.guildData.save(); await data.guildData.save();

View file

@ -87,6 +87,7 @@ class Set extends BaseCommand {
switch (type) { switch (type) {
case "level": { case "level": {
memberData.level = int; memberData.level = int;
memberData.markModified("level"); memberData.markModified("level");
await memberData.save(); await memberData.save();
@ -98,6 +99,7 @@ class Set extends BaseCommand {
case "xp": { case "xp": {
memberData.exp = int; memberData.exp = int;
memberData.markModified("exp"); memberData.markModified("exp");
await memberData.save(); await memberData.save();
@ -109,6 +111,7 @@ class Set extends BaseCommand {
case "credits": { case "credits": {
memberData.money = int; memberData.money = int;
memberData.markModified("money"); memberData.markModified("money");
await memberData.save(); await memberData.save();
@ -120,6 +123,7 @@ class Set extends BaseCommand {
case "bank": { case "bank": {
memberData.bankSold = int; memberData.bankSold = int;
memberData.markModified("bankSold"); memberData.markModified("bankSold");
await memberData.save(); await memberData.save();

View file

@ -51,6 +51,7 @@ class Setlang extends BaseCommand {
language = client.languages.find(l => l.name === lang); language = client.languages.find(l => l.name === lang);
data.guildData.language = language.name; data.guildData.language = language.name;
data.guildData.markModified("language"); data.guildData.markModified("language");
await data.guildData.save(); await data.guildData.save();

View file

@ -107,6 +107,7 @@ class Welcome extends BaseCommand {
channelID: null, channelID: null,
withImage: null, withImage: null,
}; };
data.guildData.markModified("plugins.welcome"); data.guildData.markModified("plugins.welcome");
await data.guildData.save(); await data.guildData.save();
@ -122,6 +123,7 @@ class Welcome extends BaseCommand {
message: message, message: message,
withImage: image, withImage: image,
}; };
data.guildData.markModified("plugins.welcome"); data.guildData.markModified("plugins.welcome");
await data.guildData.save(); await data.guildData.save();

View file

@ -68,6 +68,7 @@ class Bank extends BaseCommand {
data.memberData.money -= credits; data.memberData.money -= credits;
data.memberData.bankSold += credits; data.memberData.bankSold += credits;
data.memberData.markModified("money"); data.memberData.markModified("money");
data.memberData.markModified("bankSold"); data.memberData.markModified("bankSold");
await data.memberData.save(); await data.memberData.save();
@ -102,6 +103,7 @@ class Bank extends BaseCommand {
data.memberData.money += credits; data.memberData.money += credits;
data.memberData.bankSold -= credits; data.memberData.bankSold -= credits;
data.memberData.markModified("money"); data.memberData.markModified("money");
data.memberData.markModified("bankSold"); data.memberData.markModified("bankSold");
await data.memberData.save(); await data.memberData.save();

View file

@ -89,6 +89,7 @@ class Birthdate extends BaseCommand {
if (d.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW"); if (d.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW");
data.userData.birthdate = d; data.userData.birthdate = d;
data.userData.markModified("birthdate"); data.userData.markModified("birthdate");
await data.userData.save(); await data.userData.save();

View file

@ -39,6 +39,7 @@ class Divorce extends BaseCommand {
const user = client.users.cache.get(data.userData.lover) || (await client.users.fetch(data.userData.lover)); const user = client.users.cache.get(data.userData.lover) || (await client.users.fetch(data.userData.lover));
data.userData.lover = null; data.userData.lover = null;
data.user.markModified("lover"); data.user.markModified("lover");
await data.userData.save(); await data.userData.save();
@ -46,6 +47,7 @@ class Divorce extends BaseCommand {
id: user.id, id: user.id,
}); });
oldLover.lover = null; oldLover.lover = null;
oldLover.markModified("lover"); oldLover.markModified("lover");
await oldLover.save(); await oldLover.save();

View file

@ -132,6 +132,7 @@ class Marry extends BaseCommand {
data.userData.markModified("lover"); data.userData.markModified("lover");
await data.userData.save(); await data.userData.save();
userData.markModified("lover"); userData.markModified("lover");
await userData.save(); await userData.save();
@ -151,6 +152,7 @@ class Marry extends BaseCommand {
sent = true; sent = true;
userData.achievements.married.achieved = true; userData.achievements.married.achieved = true;
userData.achievements.married.progress.now = 1; userData.achievements.married.progress.now = 1;
userData.markModified("achievements.married"); userData.markModified("achievements.married");
await userData.save(); await userData.save();
} }
@ -159,6 +161,7 @@ class Marry extends BaseCommand {
if (!sent) interaction.followUp(messageOptions); if (!sent) interaction.followUp(messageOptions);
data.userData.achievements.married.achieved = true; data.userData.achievements.married.achieved = true;
data.userData.achievements.married.progress.now = 1; data.userData.achievements.married.progress.now = 1;
data.userData.markModified("achievements.married"); data.userData.markModified("achievements.married");
await data.userData.save(); await data.userData.save();
} }

View file

@ -72,10 +72,12 @@ class Pay extends BaseCommand {
}); });
data.memberData.money -= amount; data.memberData.money -= amount;
data.memberData.markModified("money"); data.memberData.markModified("money");
await data.memberData.save(); await data.memberData.save();
memberData.money += amount; memberData.money += amount;
memberData.markModified("money"); memberData.markModified("money");
await memberData.save(); await memberData.save();

View file

@ -61,6 +61,7 @@ class Rep extends BaseCommand {
if (!data.userData.cooldowns) data.userData.cooldowns = {}; if (!data.userData.cooldowns) data.userData.cooldowns = {};
data.userData.cooldowns.rep = toWait; data.userData.cooldowns.rep = toWait;
data.userData.markModified("cooldowns"); data.userData.markModified("cooldowns");
await data.userData.save(); await data.userData.save();
@ -84,6 +85,7 @@ class Rep extends BaseCommand {
], ],
}); });
} }
userData.markModified("achievements.rep"); userData.markModified("achievements.rep");
} }
await userData.save(); await userData.save();

View file

@ -87,6 +87,7 @@ class Rob extends BaseCommand {
randomNum = client.functions.randomNum(1, 2); randomNum = client.functions.randomNum(1, 2);
memberData.cooldowns.rob = toWait; memberData.cooldowns.rob = toWait;
memberData.markModified("cooldowns"); memberData.markModified("cooldowns");
await memberData.save(); await memberData.save();
@ -100,7 +101,6 @@ class Rob extends BaseCommand {
data.memberData.markModified("money"); data.memberData.markModified("money");
memberData.markModified("money"); memberData.markModified("money");
await data.memberData.save(); await data.memberData.save();
await memberData.save(); await memberData.save();
} else { } else {
@ -118,7 +118,6 @@ class Rob extends BaseCommand {
data.memberData.markModified("money"); data.memberData.markModified("money");
memberData.markModified("money"); memberData.markModified("money");
await data.memberData.save(); await data.memberData.save();
await memberData.save(); await memberData.save();
} }

View file

@ -49,6 +49,7 @@ class Setbio extends BaseCommand {
if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS"); if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS");
data.userData.bio = newBio; data.userData.bio = newBio;
data.memberData.markModified("bio"); data.memberData.markModified("bio");
await data.userData.save(); await data.userData.save();

View file

@ -145,6 +145,7 @@ class Slots extends BaseCommand {
], ],
}); });
} }
data.userData.markModified("achievements.slots"); data.userData.markModified("achievements.slots");
await data.userData.save(); await data.userData.save();
} }
@ -195,6 +196,7 @@ class Slots extends BaseCommand {
], ],
}); });
} }
data.userData.markModified("achievements.slots"); data.userData.markModified("achievements.slots");
await data.userData.save(); await data.userData.save();
} }
@ -225,6 +227,7 @@ class Slots extends BaseCommand {
if (!data.userData.achievements.slots.achieved) { if (!data.userData.achievements.slots.achieved) {
data.userData.achievements.slots.progress.now = 0; data.userData.achievements.slots.progress.now = 0;
data.userData.markModified("achievements.slots"); data.userData.markModified("achievements.slots");
await data.userData.save(); await data.userData.save();
} }

View file

@ -46,6 +46,7 @@ class Transactions extends BaseCommand {
async execute(client, interaction, data) { async execute(client, interaction, data) {
if (interaction.options.getBoolean("clear")) { if (interaction.options.getBoolean("clear")) {
data.memberData.transactions = []; data.memberData.transactions = [];
data.memberData.markModified("transactions"); data.memberData.markModified("transactions");
await data.memberData.save(); await data.memberData.save();

View file

@ -46,9 +46,11 @@ class Work extends BaseCommand {
const toWait = Date.now() + 24 * 60 * 60 * 1000; // 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.workStreak = (data.memberData.workStreak || 0) + 1; data.memberData.workStreak = (data.memberData.workStreak || 0) + 1;
data.memberData.markModified("cooldowns");
data.memberData.markModified("workStreak");
await data.memberData.save(); await data.memberData.save();
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
@ -98,6 +100,7 @@ class Work extends BaseCommand {
} }
data.memberData.money += won; data.memberData.money += won;
data.memberData.markModified("money"); data.memberData.markModified("money");
await data.memberData.save(); await data.memberData.save();
@ -124,6 +127,7 @@ class Work extends BaseCommand {
]; ];
data.userData.achievements.work.achieved = true; data.userData.achievements.work.achieved = true;
} }
data.userData.markModified("achievements.work"); data.userData.markModified("achievements.work");
await data.userData.save(); await data.userData.save();
} }

View file

@ -57,6 +57,7 @@ class TicTacToe extends BaseCommand {
}); });
memberData.money += 100; memberData.money += 100;
memberData.markModified("money"); memberData.markModified("money");
await memberData.save(); await memberData.save();

View file

@ -50,6 +50,7 @@ class Afk extends BaseCommand {
const reason = interaction.options.getString("message"); const reason = interaction.options.getString("message");
data.userData.afk = reason; data.userData.afk = reason;
data.userData.markModified("afk"); data.userData.markModified("afk");
await data.userData.save(); await data.userData.save();

View file

@ -71,8 +71,10 @@ class Remindme extends BaseCommand {
}; };
data.userData.reminds.push(rData); data.userData.reminds.push(rData);
data.userData.markModified("reminds"); data.userData.markModified("reminds");
data.userData.save(); data.userData.save();
client.databaseCache.usersReminds.set(interaction.member.id, data.userData); client.databaseCache.usersReminds.set(interaction.member.id, data.userData);
interaction.success("general/remindme:SAVED", { interaction.success("general/remindme:SAVED", {

View file

@ -54,6 +54,7 @@ class Clearwarns extends BaseCommand {
}); });
memberData.sanctions = []; memberData.sanctions = [];
memberData.markModified("sanctions"); memberData.markModified("sanctions");
memberData.save(); memberData.save();

View file

@ -177,6 +177,7 @@ class Warn extends BaseCommand {
.setColor(client.config.embed.color); .setColor(client.config.embed.color);
memberData.sanctions.push(caseInfo); memberData.sanctions.push(caseInfo);
memberData.markModified("sanctions"); memberData.markModified("sanctions");
memberData.save(); memberData.save();

View file

@ -147,6 +147,7 @@ class Debug extends BaseCommand {
switch (type) { switch (type) {
case "level": { case "level": {
memberData.level = int; memberData.level = int;
memberData.markModified("level"); memberData.markModified("level");
await memberData.save(); await memberData.save();
@ -158,6 +159,7 @@ class Debug extends BaseCommand {
case "xp": { case "xp": {
memberData.exp = int; memberData.exp = int;
memberData.markModified("exp"); memberData.markModified("exp");
await memberData.save(); await memberData.save();
@ -169,6 +171,7 @@ class Debug extends BaseCommand {
case "credits": { case "credits": {
memberData.money = int; memberData.money = int;
memberData.markModified("money"); memberData.markModified("money");
await memberData.save(); await memberData.save();
@ -180,6 +183,7 @@ class Debug extends BaseCommand {
case "bank": { case "bank": {
memberData.bankSold = int; memberData.bankSold = int;
memberData.markModified("bankSold"); memberData.markModified("bankSold");
await memberData.save(); await memberData.save();
@ -191,6 +195,7 @@ class Debug extends BaseCommand {
case "rep": { case "rep": {
userData.rep = int; userData.rep = int;
userData.markModified("rep"); userData.markModified("rep");
await userData.save(); await userData.save();
@ -218,6 +223,7 @@ class Debug extends BaseCommand {
switch (type) { switch (type) {
case "level": { case "level": {
memberData.level += int; memberData.level += int;
memberData.markModified("level"); memberData.markModified("level");
await memberData.save(); await memberData.save();
@ -229,6 +235,7 @@ class Debug extends BaseCommand {
case "xp": { case "xp": {
memberData.exp += int; memberData.exp += int;
memberData.markModified("exp"); memberData.markModified("exp");
await memberData.save(); await memberData.save();
@ -240,6 +247,7 @@ class Debug extends BaseCommand {
case "credits": { case "credits": {
memberData.money += int; memberData.money += int;
memberData.markModified("money"); memberData.markModified("money");
await memberData.save(); await memberData.save();
@ -251,6 +259,7 @@ class Debug extends BaseCommand {
case "bank": { case "bank": {
memberData.bankSold += int; memberData.bankSold += int;
memberData.markModified("bankSold"); memberData.markModified("bankSold");
await memberData.save(); await memberData.save();
@ -262,6 +271,7 @@ class Debug extends BaseCommand {
case "rep": { case "rep": {
userData.rep += int; userData.rep += int;
userData.markModified("rep"); userData.markModified("rep");
await userData.save(); await userData.save();

View file

@ -44,6 +44,7 @@ class CreateTicketEmbed extends BaseCommand {
if (guildData.plugins.tickets.count === undefined) guildData.plugins.tickets.count = 0; if (guildData.plugins.tickets.count === undefined) guildData.plugins.tickets.count = 0;
guildData.plugins.tickets.count++; guildData.plugins.tickets.count++;
guildData.markModified("plugins.tickets"); guildData.markModified("plugins.tickets");
guildData.save(); guildData.save();

View file

@ -1,7 +1,6 @@
const SoftUI = require("./dashboard-core/theme/dbd-soft-ui"), const SoftUI = require("./dashboard-core/theme/dbd-soft-ui"),
DBD = require("./dashboard-core/index"), DBD = require("./dashboard-core/index"),
settings = require("./settings"), settings = require("./settings");
fs = require("fs");
const { PermissionsBitField } = require("discord.js"); const { PermissionsBitField } = require("discord.js");
@ -43,11 +42,11 @@ module.exports.load = async client => {
id: client.config.userId, id: client.config.userId,
secret: client.config.dashboard.secret, secret: client.config.dashboard.secret,
}, },
SSL: { // SSL: {
enabled: false, // enabled: false,
key: fs.readFileSync(`${__dirname}/../jababot-cloudflare.key`, "utf-8"), // key: fs.readFileSync(`${__dirname}/../jababot-cloudflare.key`, "utf-8"),
cert: fs.readFileSync(`${__dirname}/../jababot-cloudflare.crt`, "utf-8"), // cert: fs.readFileSync(`${__dirname}/../jababot-cloudflare.crt`, "utf-8"),
}, // },
cookiesSecret: client.config.dashboard.secret, cookiesSecret: client.config.dashboard.secret,
domain: client.config.dashboard.domain, domain: client.config.dashboard.domain,
redirectUri: `${client.config.dashboard.domain}${client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : ""}/discord/callback`, redirectUri: `${client.config.dashboard.domain}${client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : ""}/discord/callback`,

View file

@ -1,3 +1,8 @@
### JaBa v4.3.5
* Добавлено
* Логи удаления сообщений!\
Настройку можно найти в *config set* и в панели управления.
### JaBa v4.3.3 ### JaBa v4.3.3
* Добавлено * Добавлено
* Система Тикетов!\ * Система Тикетов!\

View file

@ -32,6 +32,7 @@ module.exports = client => [
}); });
guildData.language = newData; guildData.language = newData;
guildData.markModified("language"); guildData.markModified("language");
await guildData.save(); await guildData.save();
@ -61,6 +62,7 @@ module.exports = client => [
}); });
guildData.plugins.welcome.enabled = newData; guildData.plugins.welcome.enabled = newData;
guildData.markModified("plugins.welcome"); guildData.markModified("plugins.welcome");
await guildData.save(); await guildData.save();
@ -85,6 +87,7 @@ module.exports = client => [
}); });
guildData.plugins.welcome.withImage = newData; guildData.plugins.welcome.withImage = newData;
guildData.markModified("plugins.welcome"); guildData.markModified("plugins.welcome");
await guildData.save(); await guildData.save();
@ -109,6 +112,7 @@ module.exports = client => [
}); });
guildData.plugins.welcome.message = newData !== "" ? newData : null; guildData.plugins.welcome.message = newData !== "" ? newData : null;
guildData.markModified("plugins.welcome"); guildData.markModified("plugins.welcome");
await guildData.save(); await guildData.save();
@ -133,6 +137,7 @@ module.exports = client => [
}); });
guildData.plugins.welcome.channel = newData !== "" ? newData : null; guildData.plugins.welcome.channel = newData !== "" ? newData : null;
guildData.markModified("plugins.welcome"); guildData.markModified("plugins.welcome");
await guildData.save(); await guildData.save();
@ -164,6 +169,7 @@ module.exports = client => [
}); });
guildData.plugins.goodbye.enabled = newData; guildData.plugins.goodbye.enabled = newData;
guildData.markModified("plugins.goodbye"); guildData.markModified("plugins.goodbye");
await guildData.save(); await guildData.save();
@ -188,6 +194,7 @@ module.exports = client => [
}); });
guildData.plugins.goodbye.withImage = newData; guildData.plugins.goodbye.withImage = newData;
guildData.markModified("plugins.goodbye"); guildData.markModified("plugins.goodbye");
await guildData.save(); await guildData.save();
@ -212,6 +219,7 @@ module.exports = client => [
}); });
guildData.plugins.goodbye.message = newData !== "" ? newData : null; guildData.plugins.goodbye.message = newData !== "" ? newData : null;
guildData.markModified("plugins.goodbye"); guildData.markModified("plugins.goodbye");
await guildData.save(); await guildData.save();
@ -236,6 +244,7 @@ module.exports = client => [
}); });
guildData.plugins.goodbye.channel = newData !== "" ? newData : null; guildData.plugins.goodbye.channel = newData !== "" ? newData : null;
guildData.markModified("plugins.goodbye"); guildData.markModified("plugins.goodbye");
await guildData.save(); await guildData.save();
@ -267,6 +276,7 @@ module.exports = client => [
}); });
guildData.plugins.autorole.enabled = newData; guildData.plugins.autorole.enabled = newData;
guildData.markModified("plugins.autorole"); guildData.markModified("plugins.autorole");
await guildData.save(); await guildData.save();
@ -291,6 +301,7 @@ module.exports = client => [
}); });
guildData.plugins.autorole.role = newData !== "" ? newData : null; guildData.plugins.autorole.role = newData !== "" ? newData : null;
guildData.markModified("plugins.autorole"); guildData.markModified("plugins.autorole");
await guildData.save(); await guildData.save();
@ -322,6 +333,7 @@ module.exports = client => [
}); });
guildData.plugins.automod.enabled = newData; guildData.plugins.automod.enabled = newData;
guildData.markModified("plugins.automod"); guildData.markModified("plugins.automod");
await guildData.save(); await guildData.save();
@ -346,6 +358,7 @@ module.exports = client => [
}); });
guildData.plugins.automod.ignored = newData; guildData.plugins.automod.ignored = newData;
guildData.markModified("plugins.automod"); guildData.markModified("plugins.automod");
await guildData.save(); await guildData.save();
@ -362,7 +375,7 @@ module.exports = client => [
{ {
optionId: "monitoring_messageupdate", optionId: "monitoring_messageupdate",
optionName: "Message Update Channel", optionName: "Message Update Channel",
optionDescription: "Select a channel for messages updates logs to go to. Select \"-\" to disable", optionDescription: "Select a channel for messages update logs to go to. Select \"-\" to disable",
optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]),
getActualSet: async ({ guild }) => { getActualSet: async ({ guild }) => {
const guildData = await client.findOrCreateGuild({ const guildData = await client.findOrCreateGuild({
@ -379,6 +392,34 @@ module.exports = client => [
if (guildData.plugins.monitoring === undefined) guildData.plugins.monitoring = {}; if (guildData.plugins.monitoring === undefined) guildData.plugins.monitoring = {};
guildData.plugins.monitoring.messageUpdate = newData !== "" ? newData : null; guildData.plugins.monitoring.messageUpdate = newData !== "" ? newData : null;
guildData.markModified("plugins.monitoring");
await guildData.save();
return;
},
},
{
optionId: "monitoring_messagedelete",
optionName: "Message Deletion Channel",
optionDescription: "Select a channel for messages deletion logs to go to. Select \"-\" to disable",
optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]),
getActualSet: async ({ guild }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
return guildData.plugins?.monitoring?.messageDelete;
},
setNew: async ({ guild, newData }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
if (guildData.plugins.monitoring === undefined) guildData.plugins.monitoring = {};
guildData.plugins.monitoring.messageDelete = newData !== "" ? newData : null;
guildData.markModified("plugins.monitoring"); guildData.markModified("plugins.monitoring");
await guildData.save(); await guildData.save();
@ -410,6 +451,7 @@ module.exports = client => [
}); });
guildData.plugins.suggestions = newData !== "" ? newData : null; guildData.plugins.suggestions = newData !== "" ? newData : null;
guildData.markModified("plugins.suggestions"); guildData.markModified("plugins.suggestions");
await guildData.save(); await guildData.save();
@ -434,6 +476,7 @@ module.exports = client => [
}); });
guildData.plugins.reports = newData !== "" ? newData : null; guildData.plugins.reports = newData !== "" ? newData : null;
guildData.markModified("plugins.reports"); guildData.markModified("plugins.reports");
await guildData.save(); await guildData.save();
@ -458,6 +501,7 @@ module.exports = client => [
}); });
guildData.plugins.birthdays = newData !== "" ? newData : null; guildData.plugins.birthdays = newData !== "" ? newData : null;
guildData.markModified("plugins.birthdays"); guildData.markModified("plugins.birthdays");
await guildData.save(); await guildData.save();
@ -482,6 +526,7 @@ module.exports = client => [
}); });
guildData.plugins.modlogs = newData !== "" ? newData : null; guildData.plugins.modlogs = newData !== "" ? newData : null;
guildData.markModified("plugins.modlogs"); guildData.markModified("plugins.modlogs");
await guildData.save(); await guildData.save();

View file

@ -50,6 +50,7 @@ class CommandHandler extends BaseEvent {
userData.achievements.firstCommand.progress.now = 1; userData.achievements.firstCommand.progress.now = 1;
userData.achievements.firstCommand.achieved = true; userData.achievements.firstCommand.achieved = true;
userData.markModified("achievements.firstCommand"); userData.markModified("achievements.firstCommand");
await userData.save(); await userData.save();

View file

@ -20,6 +20,7 @@ class GuildCreate extends BaseEvent {
if (!userData.achievements.invite.achieved) { if (!userData.achievements.invite.achieved) {
userData.achievements.invite.progress.now = 1; userData.achievements.invite.progress.now = 1;
userData.achievements.invite.achieved = true; userData.achievements.invite.achieved = true;
userData.markModified("achievements.invite"); userData.markModified("achievements.invite");
await userData.save(); await userData.save();
} }

View file

@ -24,6 +24,7 @@ class GuildMemberUpdate extends BaseEvent {
userData.achievements.tip.progress.now = 1; userData.achievements.tip.progress.now = 1;
userData.achievements.tip.achieved = true; userData.achievements.tip.achieved = true;
userData.markModified("achievements.tip"); userData.markModified("achievements.tip");
await userData.save(); await userData.save();

View file

@ -102,6 +102,7 @@ class MessageCreate extends BaseEvent {
const afkReason = data.userData.afk; const afkReason = data.userData.afk;
if (afkReason) { if (afkReason) {
data.userData.afk = null; data.userData.afk = null;
data.userData.markModified("afk"); data.userData.markModified("afk");
await data.userData.save(); await data.userData.save();
@ -152,7 +153,6 @@ async function updateXp(client, msg, memberData) {
memberData.markModified("exp"); memberData.markModified("exp");
memberData.markModified("level"); memberData.markModified("level");
await memberData.save(); await memberData.save();
} }

View file

@ -1 +0,0 @@
require("play-dl").authorization();

View file

@ -47,6 +47,7 @@ module.exports.init = function (client) {
}); });
}); });
user.reminds = user.reminds.filter(r => r.sendAt >= dateNow); user.reminds = user.reminds.filter(r => r.sendAt >= dateNow);
user.markModified("reminds"); user.markModified("reminds");
await user.save(); await user.save();

View file

@ -9,12 +9,13 @@
"REPORTS": "Reports", "REPORTS": "Reports",
"SUGGESTIONS": "Suggestions", "SUGGESTIONS": "Suggestions",
"TICKETSCATEGORY": "Category For Tickets (They have folder icon)", "TICKETSCATEGORY": "Category For Tickets (They have folder icon)",
"TICKETS_NOT_CATEGORY": "Please select a **categry** channel", "TICKETS_NOT_CATEGORY": "Please select a **category** channel",
"TICKETLOGS": "Tickets Logs", "TICKETLOGS": "Tickets Logs",
"TRANSCRIPTIONLOGS": "Transcripts Logs", "TRANSCRIPTIONLOGS": "Transcripts Logs",
"MONITORING_CHANNELS": "Monitoring Channels", "MONITORING_CHANNELS": "Monitoring Channels",
"MESSAGEUPDATE": "Message Update Logs", "MESSAGEUPDATE": "Message Update Logs",
"MESSAGEDELETE": "Message Deletion Logs",
"AUTOMOD_TITLE": "Automoderation", "AUTOMOD_TITLE": "Automoderation",
"AUTOMOD_CONTENT": "Automoderation is enabled.\nIgnored channels: {{channels}}", "AUTOMOD_CONTENT": "Automoderation is enabled.\nIgnored channels: {{channels}}",

View file

@ -15,6 +15,7 @@
"MONITORING_CHANNELS": "Каналы мониторинга", "MONITORING_CHANNELS": "Каналы мониторинга",
"MESSAGEUPDATE": "Логи изменения сообщений", "MESSAGEUPDATE": "Логи изменения сообщений",
"MESSAGEDELETE": "Логи удаления сообщений",
"AUTOMOD_TITLE": "Автомодерация", "AUTOMOD_TITLE": "Автомодерация",
"AUTOMOD_CONTENT": "Автомодерация включена.\nИгнорируемые каналы: {{channels}}", "AUTOMOD_CONTENT": "Автомодерация включена.\nИгнорируемые каналы: {{channels}}",

View file

@ -13,8 +13,9 @@
"TICKETLOGS": "Логи тікетів", "TICKETLOGS": "Логи тікетів",
"TRANSCRIPTIONLOGS": "Логи розшифровок", "TRANSCRIPTIONLOGS": "Логи розшифровок",
"MONITORING_CHANNELS": "Каналы мониторинга", "MONITORING_CHANNELS": "Канали моніторингу",
"MESSAGEUPDATE": "Логи изменения сообщений", "MESSAGEUPDATE": "Логи зміни повідомлень",
"MESSAGEDELETE": "Логи видалення повідомлень",
"AUTOMOD_TITLE": "Автомодерація", "AUTOMOD_TITLE": "Автомодерація",
"AUTOMOD_CONTENT": "Автомодерація включена.\nІгноровані канали: {{channels}}", "AUTOMOD_CONTENT": "Автомодерація включена.\nІгноровані канали: {{channels}}",

View file

@ -1,6 +1,6 @@
{ {
"name": "jaba", "name": "jaba",
"version": "4.3.3", "version": "4.3.5",
"description": "My Discord Bot", "description": "My Discord Bot",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {