Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"cron": "^2.1.0",
"discord-api-types": "^0.37.11",
"discord-hybrid-sharding": "^2.1.0",
"discord.js": "14.5.0",
"discord.js": "^14.7.1",
"dotenv": "^16.0.3",
"dungeon-api": "^1.0.5",
"express": "^4.18.1",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/

Expand Down
5 changes: 3 additions & 2 deletions src/commands/dailymsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ module.exports = {
const {Daily} = require(`../languages/${guildDb.language}.json`);
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|| global.checkDebug(guildDb, interaction?.user?.id)
) {
switch (interaction.options.getSubcommand()) {
case 'message': {
Expand Down Expand Up @@ -146,7 +147,7 @@ module.exports = {

await client.database.updateGuild(interaction.guildId, {
dailyRather: types,
}, true)
}, true);

daily = new EmbedBuilder()
.setTitle(`${Daily.successEmbed.title} Would You`)
Expand Down Expand Up @@ -262,7 +263,7 @@ module.exports = {
.setColor('#F00505')
.setTitle('Error!')
.setDescription(Daily.embed.error);
await interaction.reply({
return interaction.reply({
embeds: [errorembed],
ephemeral: true,
}).catch((err) => {
Expand Down
165 changes: 165 additions & 0 deletions src/commands/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
const {
CommandInteraction,
EmbedBuilder,
SlashCommandBuilder,
ActionRowBuilder,
ButtonBuilder, PermissionFlagsBits,
} = require('discord.js');
const guildModel = require('../util/Models/guildModel');

module.exports = {
requireGuild: true,
data: new SlashCommandBuilder()
.setName('debug')
.setDescription('Debug the would you bot')
.setDMPermission(false)
.setDescriptionLocalizations({
de: 'Debug den would you bot',
"es-ES": 'Depurar el bot'
})
.addSubcommand((subcommand) =>
subcommand
.setName('mode')
.setDescription('Set the bot to debug mode. This allows our developers to use commands without permissions.')
)
.addSubcommand((subcommand) =>
subcommand
.setName('webhook')
.setDescription('Debug if the daily webhook work.')
)
.addSubcommand((subcommand) =>
subcommand
.setName('channel')
.setDescription('Debug the current channel to view some permissons information\'s.')
),

/**
* @param {CommandInteraction} interaction
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild) || global.checkDebug(guildDb, interaction?.user?.id)) {
const errorembed = new EmbedBuilder()
.setColor('#F00505')
.setTitle('Error!')
.setDescription(client.translation.get(guildDb?.language, 'Debug.permissions'));
return interaction.reply({
embeds: [errorembed],
ephemeral: true,
}).catch((err) => {
return;
});
}

switch (interaction.options.getSubcommand()) {
case 'webhook': {
if(!guildDb?.dailyChannel || !interaction.guild.channels.cache.has(guildDb?.dailyChannel)) return interaction.reply({
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Debug.channelNotSet')
});

await client.webhookHandler.sendWebhook(null, guildDb?.dailyChannel, {
content: client.translation.get(guildDb?.language, 'Debug.testMessage')
});

return interaction.reply({
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Debug.tryToSent')
});
}
case 'mode': {
if (guildDb?.debugMode) {
await client.database.updateGuild(interaction.guildId, {
debugMode: false,
}, true);

return interaction.reply({
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Debug.disabled')
});
} else {
await client.database.updateGuild(interaction.guildId, {
debugMode: true,
}, true);

return interaction.reply({
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Debug.enabled')
});
}
}
case 'channel': {
const debugEmbed = new EmbedBuilder()
.setColor('#0598F6')
.setTimestamp()
.setTitle(client.translation.get(guildDb?.language, 'Debug.embed.title'))
.setDescription(
`**${client.translation.get(guildDb?.language, 'Debug.embed.settings')}:**\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.isChannel', {
is: interaction?.channel?.id == guildDb?.dailyChannel ? client.translation.get(guildDb?.language, 'Debug.embed.is') : client.translation.get(guildDb?.language, 'Debug.embed.isnot')
})}\n` +
`**${client.translation.get(guildDb?.language, 'Debug.embed.channel')}:**\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.manageWebhook', {
can: interaction?.channel?.permissionsFor(client?.user?.id).has([PermissionFlagsBits.ManageWebhooks])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.embedLinks', {
can: interaction?.channel?.permissionsFor(client?.user?.id).has([PermissionFlagsBits.EmbedLinks])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.sendMessages', {
can: interaction?.channel?.permissionsFor(client?.user?.id).has([PermissionFlagsBits.SendMessages])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.viewChannel', {
can: interaction?.channel?.permissionsFor(client?.user?.id).has([PermissionFlagsBits.ViewChannel])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.readMessageHistory', {
can: interaction?.channel?.permissionsFor(client?.user?.id).has([PermissionFlagsBits.ReadMessageHistory])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
'\n' +
`**${client.translation.get(guildDb?.language, 'Debug.embed.global')}:**\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.g_manageWebhooks', {
can: interaction?.guild?.members?.me?.permissions?.has([PermissionFlagsBits.ManageWebhooks])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.g_embedLinks', {
can: interaction?.guild?.members?.me?.permissions?.has([PermissionFlagsBits.EmbedLinks])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.g_sendMessages', {
can: interaction?.guild?.members?.me?.permissions?.has([PermissionFlagsBits.SendMessages])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.g_viewChannel', {
can: interaction?.guild?.members?.me?.permissions?.has([PermissionFlagsBits.ViewChannel])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n` +
`${client.translation.get(guildDb?.language, 'Debug.embed.g_readMessageHistory', {
can: interaction?.guild?.members?.me?.permissions?.has([PermissionFlagsBits.ReadMessageHistory])
? client.translation.get(guildDb?.language, 'Debug.embed.can')
: client.translation.get(guildDb?.language, 'Debug.embed.cannot')
})}\n`
)

return interaction.reply({
embeds: [debugEmbed],
}).catch((err) => {

});
}
}
},
};
2 changes: 1 addition & 1 deletion src/commands/guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/

Expand Down
4 changes: 2 additions & 2 deletions src/commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
}),
/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand All @@ -27,7 +27,7 @@ module.exports = {
let type;
if (guildDb.language === "de_DE") {
type = "de"
} else if (guildDb.language === "en_US") {
} else if (guildDb.language === "en_EN") {
type = "en"
} else if (guildDb.language === "es_ES") {
type = "es"
Expand Down
12 changes: 9 additions & 3 deletions src/commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
}),
/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand All @@ -29,9 +29,15 @@ module.exports = {
.setTitle('Bot Info')
.addFields(
{
name: 'Developers 🐧',
name: 'Bot Developers 🐧',
value: `
\`\`\`Dominik#5555\nForGetFulSkyBro#9999\nfb_sean#1337\nImGajeed76#5617\n\`\`\``,
\`\`\`Dominik#5555\nForGetFulSkyBro#9999\nfb_sean#1337\`\`\``,
inline: false,
},
{
name: 'Web Developer ⛄',
value: `
\`\`\`MarcDev#6826\`\`\``,
inline: false,
},
{
Expand Down
3 changes: 2 additions & 1 deletion src/commands/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
let languageembed;
const {Language} = require(`../languages/${guildDb.language}.json`);
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|| global.checkDebug(guildDb, interaction?.user?.id)
) {
switch (interaction.options.getSubcommand()) {
case 'english': {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/rather.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/

Expand Down
2 changes: 1 addition & 1 deletion src/commands/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
*/

async execute(interaction, client) {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
const {REPLAY} = require(`../languages/${guildDb.language}.json`);
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|| global.checkDebug(guildDb, interaction?.user?.id)
) {
switch (interaction.options.getSubcommand()) {
case "toggle":
Expand Down
2 changes: 1 addition & 1 deletion src/commands/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
*/

async execute(interaction, client) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
const {Welcome} = require(`../languages/${guildDb.language}.json`);
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|| global.checkDebug(guildDb, interaction?.user?.id)
) {
switch (interaction.options.getSubcommand()) {
case 'add':
Expand Down
2 changes: 1 addition & 1 deletion src/commands/wouldyou.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/wwyd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {

/**
* @param {CommandInteraction} interaction
* @param {Client} client
* @param {WouldYou} client
* @param {guildModel} guildDb
*/
async execute(interaction, client, guildDb) {
Expand Down
1 change: 1 addition & 0 deletions src/commands/wycustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ module.exports = {
}
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|| global.checkDebug(guildDb, interaction?.user?.id)
) {
switch (interaction.options.getSubcommand()) {
case 'add':
Expand Down
Loading