diff --git a/.gitignore b/.gitignore index d81631d1..2b86767f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,3 @@ Thumbs.db # Node node_modules - -# Dashboard DB -/json.sqlite diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index f1ab3994..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "dashboard/dashboard-core"] - path = dashboard/dashboard-core - url = https://git.jonnybro.ru/jonny_bro/dashboard-core - branch = main diff --git a/README.md b/README.md index 86ba4dc0..7c6f0eb0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ JaBa offers: * Slash and Context commands. * Supports commands in DMs. * Localization support (any language; English, Russian and Ukrainian for now). -* Dashboard for changing various settings. * Basic messages monitoring (updating and deletion). ## Commands @@ -29,10 +28,6 @@ JaBa does many thing, here is **8 main categories**: * **General**: `afk`, `avatar`, `boosters`, `minecraft`, `remindme`, `shorturl`, `serverinfo`, `userinfo`, `whois` and **7** more! * **Bot's owner commands**: `eval`, `servers`, `reload` and **2** more! -## *Kinda* Cool Dashboard - -JaBa has it's own dashboard to change server's settings! - ## Get The Bot ### Ready To Use @@ -53,7 +48,6 @@ Use [this instruction](https://github.com/JonnyBro/JaBa/wiki/Self-Hosting) to le * [Full commands list](https://dash.jababot.ru/commands) * [Discord](https://discord.gg/Ptkj2n9nzZ) * [Github](https://github.com/JonnyBro/JaBa/) -* [Dashboard](https://dash.jababot.ru) ## Support @@ -63,7 +57,6 @@ If you want to contribute, feel free to fork this repo and making a pull request ## TODO * [ ] Refactor [tictactoe](./helpers/tictactoe.js). -* [ ] Finish and release *dashboard-core* submodule. ## License diff --git a/base/Client.js b/base/Client.js index d5e50f83..9cead419 100644 --- a/base/Client.js +++ b/base/Client.js @@ -26,7 +26,6 @@ class JaBaClient extends Client { this.guildsData = require("../base/Guild"); this.usersData = require("../base/User"); this.membersData = require("../base/Member"); - this.dashboard = require("../dashboard/dashboard"); this.databaseCache = {}; this.databaseCache.users = new Collection(); diff --git a/clips/.gitkeep b/clips/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/commands/Administration/config.js b/commands/Administration/config.js index c0aa1f57..e4b5236a 100644 --- a/commands/Administration/config.js +++ b/commands/Administration/config.js @@ -156,10 +156,6 @@ class Config extends BaseCommand { `${interaction.translate("administration/config:TICKETLOGS")}: ${guildData.plugins?.tickets?.ticketLogs ? `<#${guildData.plugins?.tickets?.ticketLogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`}\n` + `${interaction.translate("administration/config:TRANSCRIPTIONLOGS")}: ${guildData.plugins?.tickets?.transcriptionLogs ? `<#${guildData.plugins?.tickets?.transcriptionLogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`}\n`, }, - { - name: interaction.translate("administration/config:DASHBOARD_TITLE"), - value: `[${interaction.translate("administration/config:DASHBOARD_CONTENT")}](${client.config.dashboard.domain})`, - }, ], }); diff --git a/commands/General/stats.js b/commands/General/stats.js index 7cc62b61..2813fcb2 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -91,7 +91,6 @@ class Stats extends BaseCommand { { name: client.customEmojis.link + " " + interaction.translate("general/stats:LINKS_TITLE"), value: interaction.translate("misc:STATS_FOOTER", { - dashboardLink: client.config.dashboard.domain, supportLink: "https://discord.gg/Ptkj2n9nzZ", inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] }), owner: client.config.owner.id, diff --git a/commands/Music/clips.js b/commands/Music/clips.js deleted file mode 100644 index ee7fa99a..00000000 --- a/commands/Music/clips.js +++ /dev/null @@ -1,92 +0,0 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"), - { QueryType } = require("discord-player"); -const BaseCommand = require("../../base/BaseCommand"), - fs = require("fs"); - -class Clips extends BaseCommand { - /** - * - * @param {import("../base/Client")} client - */ - constructor(client) { - super({ - command: new SlashCommandBuilder() - .setName("clips") - .setDescription(client.translate("music/clips:DESCRIPTION")) - .setDescriptionLocalizations({ - uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"), - ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"), - }) - .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) - .setContexts([InteractionContextType.Guild]) - .addStringOption(option => - option - .setName("query") - .setDescription(client.translate("music/clips:QUERY")) - .setDescriptionLocalizations({ - uk: client.translate("music/clips:QUERY", null, "uk-UA"), - ru: client.translate("music/clips:QUERY", null, "ru-RU"), - }) - .setRequired(true) - .setAutocomplete(true), - ), - dirname: __dirname, - ownerOnly: false, - }); - } - - /** - * - * @param {import("../../base/Client")} client - * @param {import("discord.js").ChatInputCommandInteraction} interaction - */ - async execute(client, interaction) { - await interaction.deferReply(); - - const query = interaction.options.getString("query"), - voice = interaction.member.voice.channel; - if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { edit: true }); - - const perms = voice.permissionsFor(client.user); - if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT", null, { edit: true }); - - client.player.play(interaction.member.voice.channel, query, { - nodeOptions: { - metadata: interaction, - }, - searchEngine: QueryType.FILE, - selfDeaf: true, - leaveOnEnd: false, - leaveOnStop: true, - skipOnNoStream: true, - bufferingTimeout: 1000, - }); - - interaction.editReply({ - content: interaction.translate("music/play:ADDED_QUEUE", { - songName: query.substring(8, query.length - 4), - }), - }); - } - - /** - * - * @param {import("../../base/Client")} client - * @param {import("discord.js").AutocompleteInteraction} interaction - * @returns - */ - async autocompleteRun(client, interaction) { - const query = interaction.options.getString("query"), - files = fs.readdirSync("./clips"), - results = files.filter(f => f.includes(query)); - - return await interaction.respond( - results.slice(0, 25).map(file => ({ - name: file.substring(0, file.length - 4), - value: `./clips/${file}`, - })), - ); - } -} - -module.exports = Clips; diff --git a/config.sample.js b/config.sample.js index fd73d453..4102afe6 100644 --- a/config.sample.js +++ b/config.sample.js @@ -21,15 +21,6 @@ module.exports = { logs: "123456789098765432", // The channel's ID for logs on the support server (when bot joins or leaves a guild) invite: "https://discord.gg/discord", // Invite link to the support server }, - /* Dashboard configuration */ - dashboard: { - enabled: false, // Whether the dashboard is enabled or not - maintanceKey: "letmein", // Maintance key - port: 80, // Dashboard port - domain: "http://localhost", // The base URL of the dashboard without / at the end - secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", // Your Bot's Client Secret - logs: "123456789098765432", // The channel ID for logs - }, /* Embeds defaults */ embed: { color: "#00FF00", // Color diff --git a/dashboard/dashboard-core b/dashboard/dashboard-core deleted file mode 160000 index 42cb4400..00000000 --- a/dashboard/dashboard-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42cb44000f844f17b0d9e12e15a45ab60f3dcdb7 diff --git a/dashboard/dashboard.js b/dashboard/dashboard.js deleted file mode 100644 index 8279623d..00000000 --- a/dashboard/dashboard.js +++ /dev/null @@ -1,221 +0,0 @@ -const SoftUI = require("./dashboard-core/theme/dbd-soft-ui"), - DBD = require("./dashboard-core/index"), - settings = require("./settings"); - -const { PermissionsBitField } = require("discord.js"); - -const locales = { - "en-US": require("../languages/en-US/dashboard.json"), - "ru-RU": require("../languages/ru-RU/dashboard.json"), - "uk-UA": require("../languages/uk-UA/dashboard.json"), -}; - -/** - * - * @param {import("../base/Client")} client - */ -module.exports.load = async client => { - const commands = client.commands.map(v => { - return { - commandName: v.command.name, - commandDescription: client.translate(`${v.category.toLowerCase()}/${v.command.name}:DESCRIPTION`), - commandUsage: client.translate(`${v.category.toLowerCase()}/${v.command.name}:USAGE`), - commandAlias: "", - _category: v.category, - }; - }); - let categories = []; - - commands.forEach(c => { - if (!categories.includes(c._category)) categories.push(c._category); - }); - - categories = categories.map(c => { - return { - category: c, - categoryId: c.toLowerCase(), - subTitle: "", - hideAlias: true, - hideDescription: false, - hideSidebarItem: c === "Owner" || c === "IAT" ? true : false, - list: commands.filter(v => v._category === c), - }; - }); - - const Dashboard = new DBD.Dashboard({ - port: client.config.dashboard.port, - client: { - id: client.user.id, - secret: client.config.dashboard.secret, - }, - cookiesSecret: client.config.dashboard.secret, - domain: client.config.dashboard.domain, - redirectUri: `${client.config.dashboard.domain}/discord/callback`, - bot: client, - ownerIDs: [client.config.owner.id], - requiredPermissions: PermissionsBitField.Flags.ViewChannel, - invite: { - clientId: client.user.id, - scopes: ["bot", "applications.commands"], - permissions: "8", - redirectUri: `${client.config.dashboard.domain}`, - }, - supportServer: { - slash: "/support", - inviteUrl: client.config.support.invite, - }, - rateLimits: { - manage: { - windowMs: 15 * 60 * 1000, // 15 minutes - max: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes) - message: "You are ratelimited!", // Message returned if user should be rate limited, could be also JSON/HTML - store: null, // - if null, new MemoryStore() - // supported stores: https://www.npmjs.com/package/express-rate-limit#store - }, - guildPage: { - windowMs: 15 * 60 * 1000, - max: 100, - message: "You are ratelimited!", - store: null, - }, - settingsUpdatePostAPI: { - windowMs: 15 * 60 * 1000, - max: 100, - message: "You are ratelimited!", - store: null, - }, - }, - useTheme404: true, - useThemeMaintenance: true, - useUnderMaintenance: false, - underMaintenanceAccessKey: client.config.dashboard.maintanceKey, - underMaintenanceAccessPage: "/get-access", - underMaintenance: { - title: "Under Maintenance", - contentTitle: "This page is under maintenance", - texts: [ - "
", - "We still want to change for the better for you.", - "Therefore, we are introducing technical updates so that we can allow you to enjoy the quality of our services.", - "
", - `Come back to us later or join our Discord Support Server`, - ], - }, - theme: SoftUI({ - customThemeOptions: { - // eslint-disable-next-line no-unused-vars - index: async ({ req, res, config }) => { - const user = req.session?.user; - const username = (user?.discriminator === "0" ? user?.username : user?.tag) || "Guest"; - - let users = 0; - client.guilds.cache.forEach(g => { - users += g.memberCount; - }); - - const cards = [ - { - title: "Current User", - icon: "single-02", - getValue: username, - }, - { - title: "Playing music in this much servers", - icon: "settings-gear-65", - getValue: client.player.nodes.cache.size, - }, - { - title: "Users Count", - icon: "favourite-28", - getValue: users, - }, - { - title: "Servers Count", - icon: "notification-70", - getValue: `${client.guilds.cache.size - 1} out of 2000`, - progressBar: { - enabled: true, - getProgress: Math.round(((client.guilds.cache.size - 1) / 2000) * 100), - }, - }, - ]; - - return { - values: [], - graph: {}, - cards, - }; - }, - }, - websiteName: `${client.user.username} Dashboard`, - colorScheme: "blue", - supporteMail: "", - icons: { - favicon: client.user.avatarURL(), - noGuildIcon: "https://pnggrid.com/wp-content/uploads/2021/05/Discord-Logo-Circle-1024x1024.png", - sidebar: { - darkUrl: client.user.avatarURL(), - lightUrl: client.user.avatarURL(), - hideName: false, - borderRadius: "1rem", - alignCenter: true, - }, - }, - index: { - card: { - category: "JaBa Bot", - title: "Simple bot made by Jonny_Bro", - description: "JaBa's dashboard", - image: "", - link: { - enabled: false, - url: "https://github.com/JonnyBro", - }, - }, - graph: { - enabled: false, - lineGraph: true, - title: "Memory Usage", - tag: "Memory (MB)", - max: 100, - }, - }, - notify: { - errors: { - settingsSave: "Failed to save setttings", - }, - success: { - settingsSave: "Successfully saved setttings.", - login: "Successfully logged in.", - logout: "Successfully logged out.", - }, - }, - preloader: { - image: "", - spinner: true, - text: "Page is loading", - }, - commands: categories, - locales: { - enUS: locales["en-US"], - ruRU: locales["ru-RU"], - ukUA: locales["uk-UA"], - }, - }), - customPages: [ - DBD.customPagesTypes.redirectToUrl("/github", () => { - return "https://github.com/JonnyBro/JaBa"; - }), - DBD.customPagesTypes.redirectToUrl("/updates", () => { - return "https://github.com/JonnyBro/JaBa/blob/main/dashboard/docs/updates.md"; - }), - ], - settings: settings(client), - }); - - await Dashboard.init().then(() => { - client.logger.ready(`Dashboard launched on port ${client.config.dashboard.port}`); - }).catch(err => { - client.logger.error(`Dashboard failed to initialize:\n${err}`); - }); -}; diff --git a/dashboard/settings.js b/dashboard/settings.js deleted file mode 100644 index 7110aba0..00000000 --- a/dashboard/settings.js +++ /dev/null @@ -1,459 +0,0 @@ -const SoftUI = require("./dashboard-core/theme/dbd-soft-ui"), - DBD = require("./dashboard-core/index"); - -const { PermissionsBitField, ChannelType } = require("discord.js"); - -module.exports = client => [ - { - categoryId: "main", - categoryName: "Main settings", - categoryDescription: "Setup your bot here!", - categoryPermissions: PermissionsBitField.Flags.ManageGuild, - categoryOptionsList: [ - { - optionId: "lang", - optionName: "Language", - optionDescription: "Change bot's language on the server", - optionType: DBD.formTypes.select({ - English: "en-US", - Russian: "ru-RU", - Ukrainian: "uk-UA", - }), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.language; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.language = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "welcome", - optionName: "Welcome Message", - optionDescription: "Setup welcome message on the server", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "welcome_enable", - optionName: "Enabled", - optionDescription: "Toggle welcome messages sending", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.welcome.enabled; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.welcome.enabled = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "welcome_image", - optionName: "Add Image", - optionDescription: "Toggle sending an image with welcome message", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.welcome.withImage; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.welcome.withImage = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "welcome_message", - optionName: "Message", - optionDescription: "Change welcome message (You can use {user}, {server} and {membercount} wildcards)", - optionType: DBD.formTypes.input("Welcome, {user}!", 2, 100, false, false), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.welcome.message; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.welcome.message = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - { - optionId: "welcome_channel", - optionName: "Channel", - optionDescription: "Select a channel for welcome messages", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.welcome.channel; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.welcome.channel = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - ]), - }, - { - optionId: "goodbye", - optionName: "Goodbye Message", - optionDescription: "Setup goodbye message on the server", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "goodbye_enable", - optionName: "Enabled", - optionDescription: "Toggle goodbye messages sending", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.goodbye.enabled; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.goodbye.enabled = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "goodbye_image", - optionName: "Add Image", - optionDescription: "Toggle sending an image with goodbye message", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.goodbye.withImage; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.goodbye.withImage = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "goodbye_message", - optionName: "Message", - optionDescription: "Change goodbye message (You can use {user}, {server} and {membercount} wildcards)", - optionType: DBD.formTypes.input("goodbye, {user}!", 2, 100, false, false), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.goodbye.message; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.goodbye.message = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - { - optionId: "goodbye_channel", - optionName: "Channel", - optionDescription: "Select a channel for goodbye messages", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.goodbye.channel; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.goodbye.channel = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - ]), - }, - { - optionId: "autorole", - optionName: "Auto Role", - optionDescription: "Setup auto role on the server", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "autorole_enable", - optionName: "Enabled", - optionDescription: "Toggle auto role granting for new members", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.autorole.enabled; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.autorole.enabled = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "autorole_role", - optionName: "Role", - optionDescription: "Select a role for auto role. Select \"-\" to disable", - optionType: DBD.formTypes.rolesSelect(false, false, true), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.autorole.role; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.autorole.role = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - ]), - }, - { - optionId: "automod", - optionName: "Auto Mod", - optionDescription: "Setup auto mod on the server", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "automod_enable", - optionName: "Enabled", - optionDescription: "Toggle auto mod. It will remove invite links from non-moderators", - optionType: DBD.formTypes.switch(), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.automod.enabled; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.automod.enabled = newData; - - await guildData.save(); - - return; - }, - }, - { - optionId: "automod_ignore", - optionName: "Ignore Channels", - optionDescription: "Select a channels for auto mod to ignore", - optionType: DBD.formTypes.channelsMultiSelect(false, false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.automod.ignored; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.automod.ignored = newData; - - await guildData.save(); - - return; - }, - }, - ]), - }, - { - optionId: "monitoring", - optionName: "Monitoring Channels", - optionDescription: "Setup monitoring channels on the server", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "monitoring_messageupdate", - optionName: "Message Update Channel", - optionDescription: "Select a channel for messages update logs to go to. Select \"-\" to disable", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins?.monitoring?.messageUpdate; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - if (guildData.plugins.monitoring === undefined) guildData.plugins.monitoring = {}; - - guildData.plugins.monitoring.messageUpdate = newData !== "" ? newData : null; - - 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.getGuildData(guild.id); - - return guildData.plugins?.monitoring?.messageDelete; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - if (guildData.plugins.monitoring === undefined) guildData.plugins.monitoring = {}; - - guildData.plugins.monitoring.messageDelete = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - ]), - }, - { - optionId: "channels", - optionName: "Special Channels", - optionDescription: "Setup special channels on the server. Select \"-\" to disable", - optionType: SoftUI.formTypes.multiRow([ - { - optionId: "channels_suggestions", - optionName: "Suggestions Channel", - optionDescription: "Select a channel for suggestions to go to", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.suggestions; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.suggestions = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - { - optionId: "channels_reports", - optionName: "Reports Channel", - optionDescription: "Select a channel for reports to go to. Select \"-\" to disable", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.reports; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.reports = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - { - optionId: "channels_birthdays", - optionName: "Birthdays Channel", - optionDescription: "Select a channel for birthdays message to go to. Select \"-\" to disable", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.birthdays; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.birthdays = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - { - optionId: "channels_modlogs", - optionName: "Moderation Logs Channel", - optionDescription: "Select a channel for moderation logs to go to (warns). Select \"-\" to disable", - optionType: DBD.formTypes.channelsSelect(false, [ChannelType.GuildText]), - getActualSet: async ({ guild }) => { - const guildData = await client.getGuildData(guild.id); - - return guildData.plugins.modlogs; - }, - setNew: async ({ guild, newData }) => { - const guildData = await client.getGuildData(guild.id); - - guildData.plugins.modlogs = newData !== "" ? newData : null; - - await guildData.save(); - - return; - }, - }, - ]), - }, - ], - }, - { - categoryId: "test", - categoryName: "test settings", - categoryDescription: "ooga booga", - categoryPermissions: PermissionsBitField.Flags.ViewChannel, - categoryOptionsList: [ - { - optionType: DBD.formTypes.embedBuilder({ - username: "JaBa", - avatarURL: "https://cdn.discordapp.com/avatars/708637495054565426/af98d49ebc9bf28b40b45ed5a0a623b4.png?size=4096", - }), - }, - ], - }, -]; diff --git a/events/Ready.js b/events/Ready.js index 41fd0645..e3f8ff63 100644 --- a/events/Ready.js +++ b/events/Ready.js @@ -28,8 +28,6 @@ class Ready extends BaseEvent { const checkReminds = require("../helpers/checkReminds"); checkReminds.init(client); - if (client.config.dashboard.enabled) await client.dashboard.load(client); - client.logger.ready(`Loaded a total of ${commands.length} command(s).`); client.logger.ready(`${client.user.getUsername()}, ready to serve ${users} members in ${servers} servers.`); console.timeEnd("botReady"); diff --git a/languages/en-US/dashboard.json b/languages/en-US/dashboard.json deleted file mode 100644 index 315050aa..00000000 --- a/languages/en-US/dashboard.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "name": "English", - "index": { - "feeds": [ "Current User", "Playing music in this much servers", "Users Count", "Servers Count" ], - "card": { - "category": "JaBa Bot", - "title": "Simple bot made by Jonny_Bro", - "description": "Upper Text", - "image": "", - "footer": "Bottom Text" - }, - "feedsTitle": "Feeds", - "graphTitle": "Graphs" - }, - "manage": { - "settings": { - "memberCount": "Members", - "info": { - "info": "Info", - "server": "Server Information" - } - } - }, - "privacyPolicy": { - "title": "Privacy Policy", - "description": "Privacy Policy and Terms of Service", - "pp": "Complete Privacy Policy" - }, - "partials": { - "sidebar": { - "dash": "Dashboard", - "manage": "Manage Guilds", - "commands": "Commands", - "pp": "Privacy Policy", - "admin": "Admin", - "account": "Account Pages", - "login": "Sign In", - "logout": "Sign Out" - }, - "navbar": { - "home": "Home", - "pages": { - "manage": "Manage Guilds", - "settings": "Manage Guilds", - "commands": "Commands", - "pp": "Privacy Policy", - "admin": "Admin Panel", - "error": "Error", - "credits": "Credits", - "debug": "Debug", - "leaderboard": "Leaderboard", - "profile": "Profile", - "maintenance": "Under Maintenance" - } - }, - "title": { - "pages": { - "manage": "Manage Guilds", - "settings": "Manage Guilds", - "commands": "Commands", - "pp": "Privacy Policy", - "admin": "Admin Panel", - "error": "Error", - "credits": "Credits", - "debug": "Debug", - "leaderboard": "Leaderboard", - "profile": "Profile", - "maintenance": "Under Maintenance" - } - }, - "notify": { - "errors": { - "settingsSave": "Failed to save setttings" - }, - "success": { - "settingsSave": "Successfully saved setttings.", - "login": "Successfully logged in.", - "logout": "Successfully logged out." - } - }, - "preloader": { - "text": "Page is loading..." - }, - "premium": { - "title": "Want more from JaBa?", - "description": "Check out premium features below!", - "buttonText": "Become Premium" - }, - "settings": { - "title": "Site Configuration", - "description": "Configurable Viewing Options", - "theme": { - "title": "Site Theme", - "description": "Make the site more appealing for your eyes!" - }, - "language": { - "title": "Site Language", - "description": "Select your preffered language!" - } - } - } -} \ No newline at end of file diff --git a/languages/en-US/misc.json b/languages/en-US/misc.json index ed6d5cd7..baa94e62 100644 --- a/languages/en-US/misc.json +++ b/languages/en-US/misc.json @@ -15,7 +15,7 @@ "OPTION_NAN_ALL": "Please specify an integer greater than 0 or `all`.", "OWNER_ONLY": "Only the bot owner can use this command.", "SELECT_CANCELED": "Selection canceled.", - "STATS_FOOTER": "● [Dashboard]({{dashboardLink}})\n● [Support Server]({{supportLink}})\n● [Invite JaBa to Your Server]({{inviteLink}})", + "STATS_FOOTER": "● [Support Server]({{supportLink}})\n● [Invite JaBa to Your Server]({{inviteLink}})", "TIMED_OUT": "Time out.", "JUMP_TO_PAGE": "Specify the page you want to jump to (maximum **{{length}}**):", "QUOTE_TITLE": "Message from {{user}}", diff --git a/languages/ru-RU/dashboard.json b/languages/ru-RU/dashboard.json deleted file mode 100644 index c60a4107..00000000 --- a/languages/ru-RU/dashboard.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "name": "Русский", - "index": { - "feeds": [ "Текущий пользователь", "Играю музыку в стольких серверах", "Кол-во пользователей", "Кол-во серверов" ], - "card": { - "category": "JaBa Bot", - "title": "Простой бот, созданный Jonny_Bro", - "description": "Верхний текст", - "image": "", - "footer": "Нижний текст" - }, - "feedsTitle": "Новости", - "graphTitle": "Графики" - }, - "manage": { - "settings": { - "memberCount": "Участники", - "info": { - "info": "Информация", - "server": "Информация о сервере" - } - } - }, - "privacyPolicy": { - "title": "Политика конф.", - "description": "Политика конфиденциальности и Условия использования", - "pp": "Полная политика конфиденциальности" - }, - "partials": { - "sidebar": { - "dash": "Панель управления", - "manage": "Сервера", - "commands": "Команды", - "pp": "Политика конф.", - "admin": "Админ панель", - "account": "Аккаунт", - "login": "Войти", - "logout": "Выйти" - }, - "navbar": { - "home": "Главная", - "pages": { - "manage": "Настройки серверов", - "settings": "Настройки", - "commands": "Команды", - "pp": "Политика конфиденциальности", - "admin": "Админ панель", - "error": "Ошибка", - "credits": "Разработчики панели", - "debug": "Отладка", - "leaderboard": "Таблица лидеров", - "profile": "Профиль", - "maintenance": "Техобслуживание" - } - }, - "title": { - "pages": { - "manage": "Настройки серверов", - "settings": "Настройки", - "commands": "Команды", - "pp": "Политика конфиденциальности", - "admin": "Админ панель", - "error": "Ошибка", - "credits": "Разработчики панели", - "debug": "Отладка", - "leaderboard": "Таблица лидеров", - "profile": "Профиль", - "maintenance": "Техобслуживание" - } - }, - "notify": { - "errors": { - "settingsSave": "Произошла ошибка при сохранении настроек." - }, - "success": { - "settingsSave": "Настройки успешно сохранены.", - "login": "Вход успешно выполнен.", - "logout": "Выход успешно выполнен." - } - }, - "preloader": { - "text": "Загрузка..." - }, - "premium": { - "title": "Хотите большего JaBa?", - "description": "Проверьте Премиум функции!", - "buttonText": "Стать Премиум" - }, - "settings": { - "title": "Настройки сайта", - "description": "Настройте параметры панели управления", - "theme": { - "title": "Тема", - "description": "У нас есть тёмная и светлая!" - }, - "language": { - "title": "Язык", - "description": "Выберите предпочитаемый язык!" - } - } - } -} \ No newline at end of file diff --git a/languages/ru-RU/misc.json b/languages/ru-RU/misc.json index 307c3184..693cbda8 100644 --- a/languages/ru-RU/misc.json +++ b/languages/ru-RU/misc.json @@ -15,7 +15,7 @@ "OPTION_NAN_ALL": "Укажите целое число больше 0 или `all`", "OWNER_ONLY": "Данную команду может использовать только владелец бота", "SELECT_CANCELED": "Выбор отменён", - "STATS_FOOTER": "● [Панель управления]({{dashboardLink}})\n● [Сервер поддержки]({{supportLink}})\n● [Пригласить JaBa на свой сервер]({{inviteLink}})", + "STATS_FOOTER": "● [Сервер поддержки]({{supportLink}})\n● [Пригласить JaBa на свой сервер]({{inviteLink}})", "TIMED_OUT": "Время вышло", "JUMP_TO_PAGE": "Укажите страницу к которой хотите перейти (максимум **{{length}}**):", "QUOTE_TITLE": "Сообщение от {{user}}", diff --git a/languages/uk-UA/dashboard.json b/languages/uk-UA/dashboard.json deleted file mode 100644 index 6141e871..00000000 --- a/languages/uk-UA/dashboard.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "name": "Українська", - "index": { - "feeds": [ "Поточний Користувач", "Играю музыку в стольких серверах", "Кількість користувачів", "Кількість серверів" ], - "card": { - "category": "JaBa Бот", - "title": "Простий бот, створений Jonny_Bro", - "description": "Верхній Текст", - "image": "", - "footer": "Нижній Текст" - }, - "feedsTitle": "Канали", - "graphTitle": "Графіки" - }, - "manage": { - "settings": { - "memberCount": "Учасники", - "info": { - "info": "Інформація", - "server": "Інформація про Сервер" - } - } - }, - "privacyPolicy": { - "title": "Політика Конфіденційності", - "description": "Політика Конфіденційності та Умови Сервісу", - "pp": "Повна Політика Конфіденційності" - }, - "partials": { - "sidebar": { - "dash": "Панель Керування", - "manage": "Налаштування серверів", - "commands": "Команди", - "pp": "Політика Конфіденційності", - "admin": "Адмін", - "account": "Сторінки Аккаунта", - "login": "Увійти", - "logout": "Вийти" - }, - "navbar": { - "home": "Головна", - "pages": { - "manage": "Налаштування серверів", - "settings": "Керувати", - "commands": "Команди", - "pp": "Політика Конфіденційності", - "admin": "Панель Адміністратора", - "error": "Помилка", - "credits": "Автори", - "debug": "Налагодження", - "leaderboard": "Таблиця Лідерів", - "profile": "Профіль", - "maintenance": "Технічне Обслуговування" - } - }, - "title": { - "pages": { - "manage": "Керувати Гілдіями", - "settings": "Керувати", - "commands": "Команди", - "pp": "Політика Конфіденційності", - "admin": "Панель Адміністратора", - "error": "Помилка", - "credits": "Автори", - "debug": "Налагодження", - "leaderboard": "Таблиця Лідерів", - "profile": "Профіль", - "maintenance": "Технічне Обслуговування" - } - }, - "notify": { - "errors": { - "settingsSave": "Сталася помилка при збереженні налаштувань." - }, - "success": { - "settingsSave": "Налаштування успішно збережені.", - "login": "Успішний вхід.", - "logout": "Успішний вихід." - } - }, - "preloader": { - "text": "Завантаження..." - }, - "premium": { - "title": "Бажаєте більше від JaBa?", - "description": "Ознайомтесь з преміум-функціями нижче!", - "buttonText": "Стати Преміум" - }, - "settings": { - "title": "Налаштування Сайту", - "description": "Налаштовувані параметри перегляду", - "theme": { - "title": "Тема", - "description": "Зробіть сайт більш привабливим для своїх очей!" - }, - "language": { - "title": "Мова", - "description": "Виберіть бажану мову!" - } - } - } -} \ No newline at end of file diff --git a/languages/uk-UA/misc.json b/languages/uk-UA/misc.json index d5ffcdc1..383b642b 100644 --- a/languages/uk-UA/misc.json +++ b/languages/uk-UA/misc.json @@ -15,7 +15,7 @@ "OPTION_NAN_ALL": "Вкажіть ціле число більше 0 або `all`", "OWNER_ONLY": "Цю команду може використовувати тільки власник бота", "SELECT_CANCELED": "Вибір скасовано", - "STATS_FOOTER": "● [Панель керування]({{dashboardLink}})\n● [Сервер підтримки]({{supportLink}})\n● [Запросити JaBa на свій сервер]({{inviteLink}})", + "STATS_FOOTER": "● [Сервер підтримки]({{supportLink}})\n● [Запросити JaBa на свій сервер]({{inviteLink}})", "TIMED_OUT": "Час вийшов", "JUMP_TO_PAGE": "Вкажіть сторінку, до якої хочете перейти (максимум **{{length}}**):", "QUOTE_TITLE": "Повідомлення від {{user}}",