mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
v4.1.15 - https://github.com/JonnyBro/JaBa-logs
This commit is contained in:
parent
caca0a260f
commit
545684f21a
16 changed files with 158 additions and 421 deletions
|
@ -12,7 +12,28 @@ class Config extends BaseCommand {
|
||||||
.setName("config")
|
.setName("config")
|
||||||
.setDescription(client.translate("administration/config:DESCRIPTION"))
|
.setDescription(client.translate("administration/config:DESCRIPTION"))
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
|
.addSubcommand(subcommand => subcommand.setName("list")
|
||||||
|
.setDescription(client.translate("administration/config:LIST"))
|
||||||
|
)
|
||||||
|
.addSubcommand(subcommand => subcommand.setName("set")
|
||||||
|
.setDescription(client.translate("administration/config:SET"))
|
||||||
|
.addStringOption(option => option.setName("setting")
|
||||||
|
.setDescription(client.translate("administration/config:SETTING"))
|
||||||
|
.addChoices(
|
||||||
|
{ name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" },
|
||||||
|
{ name: client.translate("administration/config:MODLOGS"), value: "modlogs" },
|
||||||
|
{ name: client.translate("administration/config:NEWS"), value: "news" },
|
||||||
|
{ name: client.translate("administration/config:REPORTS"), value: "reports" },
|
||||||
|
{ name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" }
|
||||||
|
)
|
||||||
|
.setRequired(true))
|
||||||
|
.addBooleanOption(option => option.setName("state")
|
||||||
|
.setDescription(client.translate("common:STATE"))
|
||||||
|
.setRequired(true))
|
||||||
|
.addChannelOption(option => option.setName("channel")
|
||||||
|
.setDescription(client.translate("common:CHANNEL")))
|
||||||
|
),
|
||||||
aliases: [],
|
aliases: [],
|
||||||
dirname: __dirname,
|
dirname: __dirname,
|
||||||
ownerOnly: false
|
ownerOnly: false
|
||||||
|
@ -32,79 +53,123 @@ class Config extends BaseCommand {
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
*/
|
*/
|
||||||
async execute(client, interaction, data) {
|
async execute(client, interaction, data) {
|
||||||
const guildData = data.guildData;
|
const command = interaction.options.getSubcommand();
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
if (command === "list") {
|
||||||
.setAuthor({
|
const guildData = data.guildData;
|
||||||
name: interaction.guild.name,
|
|
||||||
iconURL: interaction.guild.iconURL()
|
const embed = new EmbedBuilder()
|
||||||
})
|
.setAuthor({
|
||||||
.setColor(client.config.embed.color)
|
name: interaction.guild.name,
|
||||||
.setFooter({
|
iconURL: interaction.guild.iconURL()
|
||||||
text: client.config.embed.footer
|
})
|
||||||
})
|
.setColor(client.config.embed.color)
|
||||||
.addFields([
|
.setFooter({
|
||||||
{
|
text: client.config.embed.footer
|
||||||
name: interaction.translate("administration/config:WELCOME_TITLE"),
|
})
|
||||||
value: guildData.plugins.welcome.enabled ? interaction.translate("administration/config:WELCOME_CONTENT", {
|
.addFields([
|
||||||
channel: `<#${guildData.plugins.welcome.channel}>`,
|
{
|
||||||
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
|
name: interaction.translate("administration/config:WELCOME_TITLE"),
|
||||||
}) : interaction.translate("common:DISABLED"),
|
value: guildData.plugins.welcome.enabled ? interaction.translate("administration/config:WELCOME_CONTENT", {
|
||||||
inline: true
|
channel: `<#${guildData.plugins.welcome.channel}>`,
|
||||||
},
|
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
|
||||||
{
|
}) : interaction.translate("common:DISABLED"),
|
||||||
name: interaction.translate("administration/config:GOODBYE_TITLE"),
|
inline: true
|
||||||
value: guildData.plugins.goodbye.enabled ? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
},
|
||||||
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
{
|
||||||
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
|
name: interaction.translate("administration/config:GOODBYE_TITLE"),
|
||||||
}) : interaction.translate("common:DISABLED"),
|
value: guildData.plugins.goodbye.enabled ? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
||||||
inline: true
|
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
||||||
},
|
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
|
||||||
{
|
}) : interaction.translate("common:DISABLED"),
|
||||||
name: interaction.translate("administration/config:AUTOROLE_TITLE"),
|
inline: true
|
||||||
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>`
|
},
|
||||||
: interaction.translate("common:DISABLED")
|
{
|
||||||
},
|
name: interaction.translate("administration/config:AUTOROLE_TITLE"),
|
||||||
{
|
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>`
|
||||||
name: interaction.translate("administration/config:AUTO_SANCTIONS"),
|
: interaction.translate("common:DISABLED")
|
||||||
value: (guildData.plugins.warnsSanctions.kick ? interaction.translate("administration/config:KICK_CONTENT", {
|
},
|
||||||
count: guildData.plugins.warnsSanctions.kick
|
{
|
||||||
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? interaction.translate("administration/config:BAN_CONTENT", {
|
name: interaction.translate("administration/config:AUTO_SANCTIONS"),
|
||||||
count: guildData.plugins.warnsSanctions.ban
|
value: (guildData.plugins.warnsSanctions.kick ? interaction.translate("administration/config:KICK_CONTENT", {
|
||||||
}) : interaction.translate("administration/config:BAN_NOT_DEFINED"))
|
count: guildData.plugins.warnsSanctions.kick
|
||||||
},
|
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? interaction.translate("administration/config:BAN_CONTENT", {
|
||||||
{
|
count: guildData.plugins.warnsSanctions.ban
|
||||||
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
|
}) : interaction.translate("administration/config:BAN_NOT_DEFINED"))
|
||||||
value: guildData.plugins.automod.enabled ? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
},
|
||||||
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`)
|
{
|
||||||
}) : interaction.translate("common:DISABLED")
|
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
|
||||||
},
|
value: guildData.plugins.automod.enabled ? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
||||||
{
|
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`)
|
||||||
name: interaction.translate("administration/config:SPECIAL_CHANNELS"),
|
}) : interaction.translate("common:DISABLED")
|
||||||
value: interaction.translate("administration/config:NEWS", {
|
},
|
||||||
channel: guildData.plugins.news ? `<#${guildData.plugins.news}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
{
|
||||||
}) + "\n" +
|
name: interaction.translate("administration/config:SPECIAL_CHANNELS"),
|
||||||
interaction.translate("administration/config:SUGGESTIONS", {
|
value: interaction.translate("administration/config:NEWS_LIST", {
|
||||||
|
channel: guildData.plugins.news ? `<#${guildData.plugins.news}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
||||||
|
}) + "\n" +
|
||||||
|
interaction.translate("administration/config:SUGGESTIONS_LIST", {
|
||||||
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
||||||
}) + "\n" +
|
}) + "\n" +
|
||||||
interaction.translate("administration/config:REPORTS", {
|
interaction.translate("administration/config:REPORTS_LIST", {
|
||||||
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
||||||
}) + "\n" +
|
}) + "\n" +
|
||||||
interaction.translate("administration/config:MODLOGS", {
|
interaction.translate("administration/config:MODLOGS_LIST", {
|
||||||
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
||||||
}) + "\n" +
|
}) + "\n" +
|
||||||
interaction.translate("administration/config:BIRTHDAYS", {
|
interaction.translate("administration/config:BIRTHDAYS_LIST", {
|
||||||
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: interaction.translate("administration/config:DASHBOARD_TITLE"),
|
// name: interaction.translate("administration/config:DASHBOARD_TITLE"),
|
||||||
value: `[${interaction.translate("administration/config:DASHBOARD_CONTENT")}](${client.config.dashboard.baseURL})`
|
// value: `[${interaction.translate("administration/config:DASHBOARD_CONTENT")}](${client.config.dashboard.baseURL})`
|
||||||
}
|
// }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [embed]
|
embeds: [embed],
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const setting = interaction.options.getString("setting");
|
||||||
|
const state = interaction.options.getBoolean("state");
|
||||||
|
const channel = interaction.options.getChannel("channel");
|
||||||
|
|
||||||
|
await changeSetting(interaction, setting, state, channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
||||||
|
* @param {String} setting
|
||||||
|
* @param {Boolean} state
|
||||||
|
* @param {import("discord.js").GuildTextBasedChannel} channel
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
async function changeSetting(interaction, setting, state, channel) {
|
||||||
|
if (!state) {
|
||||||
|
interaction.guild.data.plugins[setting] = null;
|
||||||
|
interaction.guild.data.markModified(`plugins.${setting}`);
|
||||||
|
await interaction.guild.data.save();
|
||||||
|
return interaction.reply({
|
||||||
|
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:DISABLED")}**`,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (channel) {
|
||||||
|
interaction.guild.data.plugins[setting] = channel.id;
|
||||||
|
interaction.guild.data.markModified(`plugins.${setting}`);
|
||||||
|
await interaction.guild.data.save();
|
||||||
|
return interaction.reply({
|
||||||
|
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
} else return interaction.reply({
|
||||||
|
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${interaction.guild.data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${interaction.guild.data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`}`,
|
||||||
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Setbirthdays extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("setbirthdays")
|
|
||||||
.setDescription(client.translate("administration/setbirthdays:DESCRIPTION"))
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
|
||||||
.addBooleanOption(option => option.setName("state")
|
|
||||||
.setDescription(client.translate("common:STATE"))
|
|
||||||
.setRequired(true))
|
|
||||||
.addChannelOption(option => option.setName("channel")
|
|
||||||
.setDescription(client.translate("common:CHANNEL"))
|
|
||||||
.addChannelTypes(ChannelType.GuildText)),
|
|
||||||
aliases: [],
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
async onLoad() {
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
async execute(client, interaction, data) {
|
|
||||||
const state = interaction.options.getBoolean("state");
|
|
||||||
const channel = interaction.options.getChannel("channel");
|
|
||||||
|
|
||||||
if (!state) {
|
|
||||||
data.guildData.plugins.birthdays = null;
|
|
||||||
data.guildData.markModified("plugins.birthdays");
|
|
||||||
await data.guildData.save();
|
|
||||||
return interaction.success("administration/setbirthdays:DISABLED");
|
|
||||||
} else {
|
|
||||||
if (channel) {
|
|
||||||
data.guildData.plugins.birthdays = channel.id;
|
|
||||||
data.guildData.markModified("plugins.birthdays");
|
|
||||||
await data.guildData.save();
|
|
||||||
interaction.success("administration/setbirthdays:ENABLED", {
|
|
||||||
channel: channel.toString()
|
|
||||||
});
|
|
||||||
} else return interaction.replyT(`administration/setbirthdays:${data.guildData.plugins.birthdays ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.birthdays ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.birthdays).toString() } : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Setbirthdays;
|
|
|
@ -1,62 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Setmodlogs extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("setmodlogs")
|
|
||||||
.setDescription(client.translate("administration/setmodlogs:DESCRIPTION"))
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
|
||||||
.addBooleanOption(option => option.setName("state")
|
|
||||||
.setDescription(client.translate("common:STATE"))
|
|
||||||
.setRequired(true))
|
|
||||||
.addChannelOption(option => option.setName("channel")
|
|
||||||
.setDescription(client.translate("common:CHANNEL"))
|
|
||||||
.addChannelTypes(ChannelType.GuildText)),
|
|
||||||
aliases: [],
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
async onLoad() {
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
async execute(client, interaction, data) {
|
|
||||||
const state = interaction.options.getBoolean("state");
|
|
||||||
const channel = interaction.options.getChannel("channel");
|
|
||||||
|
|
||||||
if (!state) {
|
|
||||||
data.guildData.plugins.modlogs = null;
|
|
||||||
data.guildData.markModified("plugins.modlogs");
|
|
||||||
await data.guildData.save();
|
|
||||||
return interaction.success("administration/setmodlogs:DISABLED");
|
|
||||||
} else {
|
|
||||||
if (channel) {
|
|
||||||
data.guildData.plugins.modlogs = channel.id;
|
|
||||||
data.guildData.markModified("plugins.modlogs");
|
|
||||||
await data.guildData.save();
|
|
||||||
interaction.success("administration/setmodlogs:ENABLED", {
|
|
||||||
channel: channel.toString()
|
|
||||||
});
|
|
||||||
} else return interaction.replyT(`administration/setmodlogs:${data.guildData.plugins.modlogs ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.modlogs ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.modlogs).toString() } : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Setmodlogs;
|
|
|
@ -1,62 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Setnews extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("setnews")
|
|
||||||
.setDescription(client.translate("administration/setnews:DESCRIPTION"))
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
|
||||||
.addBooleanOption(option => option.setName("state")
|
|
||||||
.setDescription(client.translate("common:STATE"))
|
|
||||||
.setRequired(true))
|
|
||||||
.addChannelOption(option => option.setName("channel")
|
|
||||||
.setDescription(client.translate("common:CHANNEL"))
|
|
||||||
.addChannelTypes(ChannelType.GuildText)),
|
|
||||||
aliases: [],
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
async onLoad() {
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
async execute(client, interaction, data) {
|
|
||||||
const state = interaction.options.getBoolean("state");
|
|
||||||
const channel = interaction.options.getChannel("channel");
|
|
||||||
|
|
||||||
if (!state) {
|
|
||||||
data.guildData.plugins.news = null;
|
|
||||||
data.guildData.markModified("plugins.news");
|
|
||||||
await data.guildData.save();
|
|
||||||
return interaction.success("administration/setnews:DISABLED");
|
|
||||||
} else {
|
|
||||||
if (channel) {
|
|
||||||
data.guildData.plugins.news = channel.id;
|
|
||||||
data.guildData.markModified("plugins.news");
|
|
||||||
await data.guildData.save();
|
|
||||||
interaction.success("administration/setnews:ENABLED", {
|
|
||||||
channel: channel.toString()
|
|
||||||
});
|
|
||||||
} else return interaction.replyT(`administration/setnews:${data.guildData.plugins.news ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.news ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.news).toString() } : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Setnews;
|
|
|
@ -1,62 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Setreports extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("setreports")
|
|
||||||
.setDescription(client.translate("administration/setreports:DESCRIPTION"))
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
|
||||||
.addBooleanOption(option => option.setName("state")
|
|
||||||
.setDescription(client.translate("common:STATE"))
|
|
||||||
.setRequired(true))
|
|
||||||
.addChannelOption(option => option.setName("channel")
|
|
||||||
.setDescription(client.translate("common:CHANNEL"))
|
|
||||||
.addChannelTypes(ChannelType.GuildText)),
|
|
||||||
aliases: [],
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
async onLoad() {
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
async execute(client, interaction, data) {
|
|
||||||
const state = interaction.options.getBoolean("state");
|
|
||||||
const channel = interaction.options.getChannel("channel");
|
|
||||||
|
|
||||||
if (!state) {
|
|
||||||
data.guildData.plugins.reports = null;
|
|
||||||
data.guildData.markModified("plugins.reports");
|
|
||||||
await data.guildData.save();
|
|
||||||
return interaction.success("administration/setreports:DISABLED");
|
|
||||||
} else {
|
|
||||||
if (channel) {
|
|
||||||
data.guildData.plugins.reports = channel.id;
|
|
||||||
data.guildData.markModified("plugins.reports");
|
|
||||||
await data.guildData.save();
|
|
||||||
interaction.success("administration/setreports:ENABLED", {
|
|
||||||
channel: channel.toString()
|
|
||||||
});
|
|
||||||
} else return interaction.replyT(`administration/setreports:${data.guildData.plugins.reports ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.reports ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.reports).toString() } : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Setreports;
|
|
|
@ -1,62 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Setsuggests extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("setsuggests")
|
|
||||||
.setDescription(client.translate("administration/setsuggests:DESCRIPTION"))
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
|
||||||
.addBooleanOption(option => option.setName("state")
|
|
||||||
.setDescription(client.translate("common:STATE"))
|
|
||||||
.setRequired(true))
|
|
||||||
.addChannelOption(option => option.setName("channel")
|
|
||||||
.setDescription(client.translate("common:CHANNEL"))
|
|
||||||
.addChannelTypes(ChannelType.GuildText)),
|
|
||||||
aliases: [],
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
*/
|
|
||||||
async onLoad() {
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/JaBa")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
async execute(client, interaction, data) {
|
|
||||||
const state = interaction.options.getBoolean("state");
|
|
||||||
const channel = interaction.options.getChannel("channel");
|
|
||||||
|
|
||||||
if (!state) {
|
|
||||||
data.guildData.plugins.suggestions = null;
|
|
||||||
data.guildData.markModified("plugins.suggestions");
|
|
||||||
await data.guildData.save();
|
|
||||||
return interaction.success("administration/setsuggests:DISABLED");
|
|
||||||
} else {
|
|
||||||
if (channel) {
|
|
||||||
data.guildData.plugins.suggestions = channel.id;
|
|
||||||
data.guildData.markModified("plugins.suggestions");
|
|
||||||
await data.guildData.save();
|
|
||||||
interaction.success("administration/setsuggests:ENABLED", {
|
|
||||||
channel: channel.toString()
|
|
||||||
});
|
|
||||||
} else return interaction.replyT(`administration/setsuggests:${data.guildData.plugins.suggestions ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.suggestions ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.suggestions).toString() } : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Setsuggests;
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
### JaBa v4.1.15
|
||||||
|
* Изменения
|
||||||
|
* Переписана команда *config*.
|
||||||
|
* Теперь с её помощью можно просматривать и изменять настройки сервера.
|
||||||
|
* Использование смотрите в *help*.
|
||||||
|
|
||||||
|
* Удалено
|
||||||
|
* Команды *setbirthdays*, *setmodlogs*, *setnews*, *setreports*, *setsuggests*.
|
||||||
|
|
||||||
### JaBa v4.1.14
|
### JaBa v4.1.14
|
||||||
* Добавлено
|
* Добавлено
|
||||||
* Команда *selectroles* - Возможность выбора необязательных ролей пользователями.
|
* Команда *selectroles* - Возможность выбора необязательных ролей пользователями.
|
||||||
|
|
|
@ -55,7 +55,7 @@ class CommandHandler extends BaseEvent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
client.logger.log(`User ${interaction.user.tag} used ${command.command.name} in ${interaction.guild.name} with arguments: ${interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ")}`, "cmd");
|
client.logger.log(`User ${interaction.user.tag} used ${command.command.name} in ${interaction.guild.name} with arguments: ${interaction.options.data ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args"}`, "cmd");
|
||||||
|
|
||||||
return command.execute(client, interaction, data);
|
return command.execute(client, interaction, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,26 @@
|
||||||
{
|
{
|
||||||
"DESCRIPTION": "Показать настройки сервера",
|
"DESCRIPTION": "Изменить или показать настройки сервера",
|
||||||
"USAGE": "",
|
"USAGE": "list\nset [setting] (state) (#channel)",
|
||||||
"EXAMPLES": "config",
|
"EXAMPLES": "config list\nconfig set setting:reports state:True channel:#reports",
|
||||||
|
"LIST": "Показать настройки сервера",
|
||||||
|
"SET": "Изменить настройки сервера",
|
||||||
|
"SETTING": "Параметр",
|
||||||
|
"BIRTHDAYS": "Поздравления с днём рождения",
|
||||||
|
"MODLOGS": "Логи модерации",
|
||||||
|
"NEWS": "Новости бота",
|
||||||
|
"REPORTS": "Жалобы",
|
||||||
|
"SUGGESTIONS": "Предложения",
|
||||||
|
"NEWS_LIST": "Новости бота: {{channel}}",
|
||||||
|
"MODLOGS_LIST": "Логи модерации: {{channel}}",
|
||||||
|
"BIRTHDAYS_LIST": "Поздравления с днём рождения: {{channel}}",
|
||||||
|
"SUGGESTIONS_LIST": "Предложения: {{channel}}",
|
||||||
|
"REPORTS_LIST": "Жалобы: {{channel}}",
|
||||||
"AUTOROLE_TITLE": "Автоназначение роли при входе",
|
"AUTOROLE_TITLE": "Автоназначение роли при входе",
|
||||||
"WELCOME_TITLE": "Приветствие",
|
"WELCOME_TITLE": "Приветствие",
|
||||||
"WELCOME_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
"WELCOME_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
||||||
"GOODBYE_TITLE": "Прощание",
|
"GOODBYE_TITLE": "Прощание",
|
||||||
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
||||||
"SPECIAL_CHANNELS": "Специальные каналы",
|
"SPECIAL_CHANNELS": "Специальные каналы",
|
||||||
"NEWS": "Новости бота: {{channel}}",
|
|
||||||
"MODLOGS": "Логи модерации: {{channel}}",
|
|
||||||
"BIRTHDAYS": "Поздравления с днём рождения: {{channel}}",
|
|
||||||
"SUGGESTIONS": "Предложения: {{channel}}",
|
|
||||||
"REPORTS": "Жалобы: {{channel}}",
|
|
||||||
"AUTOMOD_TITLE": "Автомодерация",
|
"AUTOMOD_TITLE": "Автомодерация",
|
||||||
"AUTOMOD_CONTENT": "Автомодерация включена.\nИгнорируемые каналы: {{channels}}",
|
"AUTOMOD_CONTENT": "Автомодерация включена.\nИгнорируемые каналы: {{channels}}",
|
||||||
"AUTO_SANCTIONS": "Автоматические наказания",
|
"AUTO_SANCTIONS": "Автоматические наказания",
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Установить канал для поздравлений с днём рождения",
|
|
||||||
"USAGE": "[state] (#channel)",
|
|
||||||
"EXAMPLES": "setbirthdays state:True channel:#birthdays\nsetbirthdays state:False",
|
|
||||||
"ENABLED": "Поздравления включены в канале **{{channel}}**!",
|
|
||||||
"DISABLED": "Поздравления отключены!"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Установить канал для логов модерации",
|
|
||||||
"USAGE": "[state] (#channel)",
|
|
||||||
"EXAMPLES": "setmodlogs state:True channel:#логи\nsetmodlogs state:False",
|
|
||||||
"ENABLED": "Логи модерации включены в канале **{{channel}}**!",
|
|
||||||
"DISABLED": "Логи модерации отключены!"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Установить канал для новостей бота",
|
|
||||||
"USAGE": "[state] (#channel)",
|
|
||||||
"EXAMPLES": "setnews state:True channel:#bot-news\nsetnews state:False",
|
|
||||||
"ENABLED": "Новости бота включены в канале **{{channel}}**!",
|
|
||||||
"DISABLED": "Новости бота отключены!"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Установить канал для жалоб",
|
|
||||||
"USAGE": "[state] (#channel)",
|
|
||||||
"EXAMPLES": "setreports state:True channel:#жалобы\nsetreports state:False",
|
|
||||||
"ENABLED": "Жалобы будут отправляться в **{{channel}}**!",
|
|
||||||
"DISABLED": "Жалобы отключены!"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Установить канал для предложений",
|
|
||||||
"USAGE": "[state] (#channel)",
|
|
||||||
"EXAMPLES": "setsuggests state:True channel:#предложения\nsetsuggests state:False",
|
|
||||||
"ENABLED": "Предложения будут отправляться в **{{channel}}**!",
|
|
||||||
"DISABLED": "Предложения отключены!"
|
|
||||||
}
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.1.14",
|
"version": "4.1.15",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.1.14",
|
"version": "4.1.15",
|
||||||
"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.1.14",
|
"version": "4.1.15",
|
||||||
"description": "My Discord Bot",
|
"description": "My Discord Bot",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
Loading…
Reference in a new issue