Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
eYuM-coder committed Dec 5, 2024
1 parent 603ad13 commit 8b7bdce
Show file tree
Hide file tree
Showing 44 changed files with 167 additions and 144 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ src/data/users.json
package-lock.json
config.json
json.sqlite
mee8.log
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"leavesPublic": "https://discord.com/api/webhooks/1313641714459607141/hiDTTsg6U91g3Tefz8FWs8YQYjqxc1rjmb9HjfbhdSl_jDxRrdr3azC1CNpjCAXymHB1",
"leavesPrivate": "https://discord.com/api/webhooks/1313641714459607141/hiDTTsg6U91g3Tefz8FWs8YQYjqxc1rjmb9HjfbhdSl_jDxRrdr3azC1CNpjCAXymHB1"
},
"maintenance": "false",
"maintenance": "true",
"maintenance_threshold": "5",
"invite_link": "https://discord.com/oauth2/authorize?client_id=1290139203023142962&permissions=1759218604441599&integration_type=0&scope=bot+applications.commands",
"seo": {
Expand Down
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ async function updateUserLevel(guildId, userId, xpGain) {
let xpNeededForNextLevel = user.level * nextLevelXP;
let previousLevel = user.level;
let currentLevel = user.level;
let currentXP = user.xp;

user.messageTimeout = Date.now();

Expand All @@ -133,7 +134,7 @@ async function updateUserLevel(guildId, userId, xpGain) {

await guild.save();

return { xpNeededForNextLevel, previousLevel, currentLevel };
return { xpNeededForNextLevel, previousLevel, currentLevel, currentXP };
}

client.on("messageCreate", async (message) => {
Expand All @@ -149,7 +150,7 @@ client.on("messageCreate", async (message) => {

if (Date.now() - user.messageTimeout >= 60000 && guild.levelingEnabled) {
const xpGain = Math.floor(Math.random() * 15) + 10;
const { previousLevel, xpNeededForNextLevel, currentLevel } = await updateUserLevel(
const { previousLevel, xpNeededForNextLevel, currentLevel, currentXP } = await updateUserLevel(
guildId,
userId,
xpGain,
Expand All @@ -164,7 +165,7 @@ client.on("messageCreate", async (message) => {
message.author.displayAvatarURL({ dynamic: true }),
)
.setDescription(`You have reached level ${currentLevel}`)
.setFooter(`XP: ${user.xp}/${xpNeededForNextLevel}`);
.setFooter(`XP: ${currentXP}/${xpNeededForNextLevel}`);

message.channel.send({ embeds: [levelbed] });
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/information/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = class extends Command {
new MessageButton()
.setLabel("Dashboard")
.setStyle("LINK")
.setURL("https://v2.pogy.xyz")
.setURL(`${process.env.AUTH_DOMAIN}/dashboard`)
);

const dashembed = new MessageEmbed()
Expand Down
3 changes: 2 additions & 1 deletion src/commands/moderation/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -112,7 +113,7 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch((e) => {
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

Expand Down
3 changes: 2 additions & 1 deletion src/commands/moderation/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Logging = require("../../database/schemas/logging.js");
const logger = require("../../utils/logger.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -165,7 +166,7 @@ module.exports = class extends Command {
.setFooter({ text: `Responsible ID: ${message.author.id}` })
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch(() => {});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/kick.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -179,7 +180,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -127,7 +128,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
6 changes: 3 additions & 3 deletions src/commands/moderation/mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ module.exports = class extends Command {
.setColor("RED")
.setDescription(
`You have been muted in **${
interaction.guild.name
}**.\n\n__**Moderator:**__ ${interaction.author} **(${
interaction.author.tag
message.guild.name
}**.\n\n__**Moderator:**__ ${message.author} **(${
message.author.tag
})**\n__**Reason:**__ ${reason || "No Reason Provided"}`
)
.setTimestamp();
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/removerole.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -162,7 +163,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
7 changes: 4 additions & 3 deletions src/commands/moderation/removewarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Guild = require("../../database/schemas/Guild.js");
const warnModel = require("../../database/models/moderation.js");
const Logging = require("../../database/schemas/logging.js");
const discord = require("discord.js");
const send = require("../../packages/logs/index.js");
module.exports = class extends Command {
constructor(...args) {
super(...args, {
Expand Down Expand Up @@ -229,9 +230,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch((e) => {
console.log(e);
});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/resetwarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Guild = require("../../database/schemas/Guild.js");
const warnModel = require("../../database/models/moderation.js");
const discord = require("discord.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");
module.exports = class extends Command {
constructor(...args) {
super(...args, {
Expand Down Expand Up @@ -161,7 +162,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/setnickname.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -228,7 +229,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/slowmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -210,7 +211,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
7 changes: 4 additions & 3 deletions src/commands/moderation/softban.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -158,9 +159,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch((e) => {
console.log(e);
});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
8 changes: 4 additions & 4 deletions src/commands/moderation/unban.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");

const send = require("../../packages/logs/index.js");
const Logging = require("../../database/schemas/logging.js");
module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -360,9 +360,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch((e) => {
console.log(e);
});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
5 changes: 4 additions & 1 deletion src/commands/moderation/unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Command = require("../../structures/Command");
const { MessageEmbed } = require("discord.js");
const Guild = require("../../database/schemas/Guild.js");
const Logging = require("../../database/schemas/logging.js");
const send = require("../../packages/logs/index.js");

module.exports = class extends Command {
constructor(...args) {
Expand Down Expand Up @@ -131,7 +132,9 @@ module.exports = class extends Command {
.setTimestamp()
.setColor(color);

channel.send({ embeds: [logEmbed] }).catch(() => {});
send(channel, { username: `${this.client.user.username}`, embeds: [logEmbed] }).catch((e) => {
console.log(e);
});

logging.moderation.caseN = logcase + 1;
await logging.save().catch(() => {});
Expand Down
Loading

0 comments on commit 8b7bdce

Please sign in to comment.