mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-12-29 23:03:02 +05:00
modules yipee
This commit is contained in:
parent
04552202df
commit
484364ba8f
47 changed files with 661 additions and 1647 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -13,6 +13,3 @@ Thumbs.db
|
||||||
|
|
||||||
# Node
|
# Node
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
# Dashboard DB
|
|
||||||
/json.sqlite
|
|
||||||
|
|
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -1,4 +0,0 @@
|
||||||
[submodule "dashboard/dashboard-core"]
|
|
||||||
path = dashboard/dashboard-core
|
|
||||||
url = https://git.jonnybro.ru/jonny_bro/dashboard-core
|
|
||||||
branch = main
|
|
|
@ -15,7 +15,6 @@ JaBa offers:
|
||||||
* Slash and Context commands.
|
* Slash and Context commands.
|
||||||
* Supports commands in DMs.
|
* Supports commands in DMs.
|
||||||
* Localization support (any language; English, Russian and Ukrainian for now).
|
* Localization support (any language; English, Russian and Ukrainian for now).
|
||||||
* Dashboard for changing various settings.
|
|
||||||
* Basic messages monitoring (updating and deletion).
|
* Basic messages monitoring (updating and deletion).
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
@ -30,10 +29,6 @@ JaBa does many thing, here is **8 main categories**:
|
||||||
* **General**: `afk`, `avatar`, `boosters`, `minecraft`, `remindme`, `shorturl`, `serverinfo`, `userinfo`, `whois` and **7** more!
|
* **General**: `afk`, `avatar`, `boosters`, `minecraft`, `remindme`, `shorturl`, `serverinfo`, `userinfo`, `whois` and **7** more!
|
||||||
* **Bot's owner commands**: `eval`, `servers`, `reload` and **2** 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
|
## Get The Bot
|
||||||
|
|
||||||
### Ready To Use
|
### Ready To Use
|
||||||
|
@ -54,7 +49,6 @@ Use [this instruction](https://github.com/JonnyBro/JaBa/wiki/Self-Hosting) to le
|
||||||
* [Full commands list](https://dash.jababot.ru/commands)
|
* [Full commands list](https://dash.jababot.ru/commands)
|
||||||
* [Discord](https://discord.gg/Ptkj2n9nzZ)
|
* [Discord](https://discord.gg/Ptkj2n9nzZ)
|
||||||
* [Github](https://github.com/JonnyBro/JaBa/)
|
* [Github](https://github.com/JonnyBro/JaBa/)
|
||||||
* [Dashboard](https://dash.jababot.ru)
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
@ -64,7 +58,7 @@ If you want to contribute, feel free to fork this repo and making a pull request
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* [ ] Refactor [tictactoe](./helpers/tictactoe.js).
|
* [ ] Refactor [tictactoe](./helpers/tictactoe.js).
|
||||||
* [ ] Finish and release *dashboard-core* submodule.
|
* [ ] Rewrite dashboard.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -11,4 +11,4 @@ class BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BaseEvent;
|
export default BaseEvent;
|
||||||
|
|
|
@ -1,32 +1,41 @@
|
||||||
const { Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder, EmbedBuilder, PermissionsBitField, ChannelType } = require("discord.js"),
|
import { Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder, EmbedBuilder, PermissionsBitField, ChannelType } from "discord.js";
|
||||||
{ GiveawaysManager } = require("discord-giveaways"),
|
import { GiveawaysManager } from "discord-giveaways";
|
||||||
{ REST } = require("@discordjs/rest"),
|
import { REST } from "@discordjs/rest";
|
||||||
{ Player: DiscordPlayer } = require("discord-player"),
|
import { Player } from "discord-player";
|
||||||
{ SpotifyExtractor } = require("@discord-player/extractor"),
|
import { SpotifyExtractor } from "@discord-player/extractor";
|
||||||
{ YoutubeiExtractor } = require("discord-player-youtubei"),
|
import { YoutubeiExtractor } from "discord-player-youtubei";
|
||||||
{ Routes } = require("discord-api-types/v10");
|
import { Routes } from "discord-api-types/v10";
|
||||||
|
import { join, sep } from "path";
|
||||||
|
import { promises as fs } from "fs";
|
||||||
|
import { setTimeout } from "timers/promises";
|
||||||
|
import mongoose from "mongoose";
|
||||||
|
|
||||||
const BaseEvent = require("./BaseEvent.js"),
|
import config from "../config.js";
|
||||||
BaseCommand = require("./BaseCommand.js").default,
|
import * as emojis from "../emojis.json";
|
||||||
path = require("path"),
|
import langs from "../languages/language-meta.js";
|
||||||
fs = require("fs").promises,
|
import logger from "../helpers/logger.js";
|
||||||
mongoose = require("mongoose");
|
import * as funcs from "../helpers/functions.js";
|
||||||
|
|
||||||
|
import BaseEvent from "./BaseEvent.js";
|
||||||
|
import BaseCommand from "./BaseCommand.js";
|
||||||
|
import guild from "./Guild.js";
|
||||||
|
import user from "./User.js";
|
||||||
|
import member from "./Member.js";
|
||||||
|
|
||||||
class JaBaClient extends Client {
|
class JaBaClient extends Client {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
|
|
||||||
this.config = require("../config");
|
this.config = config;
|
||||||
this.customEmojis = require("../emojis");
|
this.customEmojis = emojis;
|
||||||
this.languages = require("../languages/language-meta");
|
this.languages = langs;
|
||||||
this.commands = new Collection();
|
this.commands = new Collection();
|
||||||
this.logger = require("../helpers/logger");
|
this.logger = logger;
|
||||||
this.wait = require("node:timers/promises").setTimeout;
|
this.wait = setTimeout;
|
||||||
this.functions = require("../helpers/functions");
|
this.functions = funcs;
|
||||||
this.guildsData = require("../base/Guild");
|
this.guildsData = guild.default;
|
||||||
this.usersData = require("../base/User");
|
this.usersData = user.default;
|
||||||
this.membersData = require("../base/Member");
|
this.membersData = member.default;
|
||||||
this.dashboard = require("../dashboard/dashboard");
|
|
||||||
|
|
||||||
this.databaseCache = {};
|
this.databaseCache = {};
|
||||||
this.databaseCache.users = new Collection();
|
this.databaseCache.users = new Collection();
|
||||||
|
@ -43,7 +52,7 @@ class JaBaClient extends Client {
|
||||||
* @returns {Promise<void>} A Promise that resolves when the client is fully initialized.
|
* @returns {Promise<void>} A Promise that resolves when the client is fully initialized.
|
||||||
*/
|
*/
|
||||||
async init() {
|
async init() {
|
||||||
this.player = new DiscordPlayer(this);
|
this.player = new Player(this);
|
||||||
|
|
||||||
await this.player.extractors.register(YoutubeiExtractor, {
|
await this.player.extractors.register(YoutubeiExtractor, {
|
||||||
authentication: this.config.youtubeCookie,
|
authentication: this.config.youtubeCookie,
|
||||||
|
@ -74,13 +83,13 @@ class JaBaClient extends Client {
|
||||||
})
|
})
|
||||||
).id;
|
).id;
|
||||||
|
|
||||||
if (track.durationMS > 1)
|
if (track.durationMS > 1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const message = queue.metadata.channel.messages.cache.get(m);
|
const message = queue.metadata.channel.messages.cache.get(m);
|
||||||
|
|
||||||
if (message && message.deletable) message.delete();
|
if (message && message.deletable) message.delete();
|
||||||
}, track.durationMS);
|
}, track.durationMS);
|
||||||
else
|
} else {
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => {
|
() => {
|
||||||
const message = queue.metadata.channel.messages.cache.get(m);
|
const message = queue.metadata.channel.messages.cache.get(m);
|
||||||
|
@ -89,6 +98,7 @@ class JaBaClient extends Client {
|
||||||
},
|
},
|
||||||
5 * 60 * 1000,
|
5 * 60 * 1000,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.player.events.on("emptyQueue", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.data.guild.language)));
|
this.player.events.on("emptyQueue", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.data.guild.language)));
|
||||||
this.player.events.on("emptyChannel", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.data.guild.language)));
|
this.player.events.on("emptyChannel", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.data.guild.language)));
|
||||||
|
@ -113,9 +123,7 @@ class JaBaClient extends Client {
|
||||||
|
|
||||||
mongoose
|
mongoose
|
||||||
.connect(this.config.mongoDB)
|
.connect(this.config.mongoDB)
|
||||||
.then(() => {
|
.then(this.logger.log("Connected to the MongoDB database."))
|
||||||
this.logger.log("Connected to the MongoDB database.");
|
|
||||||
})
|
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
this.logger.error(`Unable to connect to the MongoDB database.\nError: ${e.message}\n${e.stack}`);
|
this.logger.error(`Unable to connect to the MongoDB database.\nError: ${e.message}\n${e.stack}`);
|
||||||
});
|
});
|
||||||
|
@ -134,8 +142,8 @@ class JaBaClient extends Client {
|
||||||
*/
|
*/
|
||||||
async loadCommands(dir) {
|
async loadCommands(dir) {
|
||||||
const rest = new REST().setToken(this.config.token),
|
const rest = new REST().setToken(this.config.token),
|
||||||
filePath = path.join(__dirname, dir),
|
filePath = join(__dirname, dir),
|
||||||
folders = (await fs.readdir(filePath)).map(file => path.join(filePath, file));
|
folders = (await fs.readdir(filePath)).map(file => join(filePath, file));
|
||||||
|
|
||||||
const commands = [];
|
const commands = [];
|
||||||
for (const folder of folders) {
|
for (const folder of folders) {
|
||||||
|
@ -144,7 +152,7 @@ class JaBaClient extends Client {
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
if (!file.endsWith(".js")) continue;
|
if (!file.endsWith(".js")) continue;
|
||||||
|
|
||||||
const Command = require(path.join(folder, file));
|
const Command = require(join(folder, file));
|
||||||
|
|
||||||
if (!(Command.prototype instanceof BaseCommand)) continue;
|
if (!(Command.prototype instanceof BaseCommand)) continue;
|
||||||
|
|
||||||
|
@ -165,8 +173,8 @@ class JaBaClient extends Client {
|
||||||
await rest.put(route, { body: commands });
|
await rest.put(route, { body: commands });
|
||||||
|
|
||||||
this.logger.log("Successfully registered application commands.");
|
this.logger.log("Successfully registered application commands.");
|
||||||
} catch (err) {
|
} catch (e) {
|
||||||
this.logger.error("Error registering application commands:", err);
|
this.logger.error("Error registering application commands:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +186,7 @@ class JaBaClient extends Client {
|
||||||
*/
|
*/
|
||||||
async loadCommand(dir, file) {
|
async loadCommand(dir, file) {
|
||||||
try {
|
try {
|
||||||
const Command = require(path.join(dir, `${file}.js`));
|
const Command = require(join(dir, `${file}.js`));
|
||||||
|
|
||||||
if (!(Command.prototype instanceof BaseCommand)) {
|
if (!(Command.prototype instanceof BaseCommand)) {
|
||||||
return this.logger.error(`Tried to load a non-command file: "${file}.js"`);
|
return this.logger.error(`Tried to load a non-command file: "${file}.js"`);
|
||||||
|
@ -190,8 +198,8 @@ class JaBaClient extends Client {
|
||||||
if (typeof command.onLoad === "function") await command.onLoad(this);
|
if (typeof command.onLoad === "function") await command.onLoad(this);
|
||||||
|
|
||||||
this.logger.log(`Successfully loaded "${file}" command file. (Command: ${command.command.name})`);
|
this.logger.log(`Successfully loaded "${file}" command file. (Command: ${command.command.name})`);
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
this.logger.error(`Error loading command "${file}":`, error);
|
this.logger.error(`Error loading command "${file}":`, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +210,7 @@ class JaBaClient extends Client {
|
||||||
* @returns {void} This method does not return a value.
|
* @returns {void} This method does not return a value.
|
||||||
*/
|
*/
|
||||||
unloadCommand(dir, name) {
|
unloadCommand(dir, name) {
|
||||||
delete require.cache[require.resolve(`${dir}${path.sep}${name}.js`)];
|
delete require.cache[require.resolve(`${dir}${sep}${name}.js`)];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -213,15 +221,15 @@ class JaBaClient extends Client {
|
||||||
* @returns {Promise<void>} This method does not return a value.
|
* @returns {Promise<void>} This method does not return a value.
|
||||||
*/
|
*/
|
||||||
async loadEvents(dir) {
|
async loadEvents(dir) {
|
||||||
const filePath = path.join(__dirname, dir);
|
const filePath = join(__dirname, dir);
|
||||||
const files = await fs.readdir(filePath);
|
const files = await fs.readdir(filePath);
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const fullPath = path.join(filePath, file);
|
const fullPath = join(filePath, file);
|
||||||
const stat = await fs.lstat(fullPath);
|
const stat = await fs.lstat(fullPath);
|
||||||
|
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
await this.loadEvents(path.join(dir, file));
|
await this.loadEvents(join(dir, file));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,8 +252,8 @@ class JaBaClient extends Client {
|
||||||
event.once ? this.once(event.name, event.execute.bind(event, this)) : this.on(event.name, event.execute.bind(event, this));
|
event.once ? this.once(event.name, event.execute.bind(event, this)) : this.on(event.name, event.execute.bind(event, this));
|
||||||
|
|
||||||
this.logger.log(`Successfully loaded "${file}" event. (Event: ${event.name})`);
|
this.logger.log(`Successfully loaded "${file}" event. (Event: ${event.name})`);
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
this.logger.error(`Error loading event "${file}":`, error);
|
this.logger.error(`Error loading event "${file}":`, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -348,6 +356,7 @@ class JaBaClient extends Client {
|
||||||
await memberData.save();
|
await memberData.save();
|
||||||
|
|
||||||
const guildData = await this.getGuildData(guildId);
|
const guildData = await this.getGuildData(guildId);
|
||||||
|
|
||||||
if (guildData) {
|
if (guildData) {
|
||||||
guildData.members.push(memberData._id);
|
guildData.members.push(memberData._id);
|
||||||
await guildData.save();
|
await guildData.save();
|
||||||
|
@ -377,4 +386,4 @@ class JaBaClient extends Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = JaBaClient;
|
export default JaBaClient;
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
const mongoose = require("mongoose"),
|
import { model, Schema } from "mongoose";
|
||||||
Schema = mongoose.Schema,
|
import { langs } from "../languages/language-meta.js";
|
||||||
languages = require("../languages/language-meta.json");
|
|
||||||
|
|
||||||
module.exports = mongoose.model("Guild", new Schema({
|
export default model(
|
||||||
|
"Guild",
|
||||||
|
new Schema({
|
||||||
id: { type: String },
|
id: { type: String },
|
||||||
|
|
||||||
membersData: { type: Object, default: {} },
|
membersData: { type: Object, default: {} },
|
||||||
members: [{ type: Schema.Types.ObjectId, ref: "Member" }],
|
members: [{ type: Schema.Types.ObjectId, ref: "Member" }],
|
||||||
|
|
||||||
language: { type: String, default: languages.find(l => l.default).name },
|
language: { type: String, default: langs.find(l => l.default).name },
|
||||||
plugins: {
|
plugins: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {
|
default: {
|
||||||
|
@ -52,4 +53,5 @@ module.exports = mongoose.model("Guild", new Schema({
|
||||||
modlogs: null,
|
modlogs: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
const mongoose = require("mongoose");
|
import { model, Schema } from "mongoose";
|
||||||
|
|
||||||
module.exports = mongoose.model("Member", new mongoose.Schema({
|
export default model(
|
||||||
|
"Member",
|
||||||
|
new Schema({
|
||||||
id: { type: String },
|
id: { type: String },
|
||||||
guildID: { type: String },
|
guildID: { type: String },
|
||||||
|
|
||||||
|
@ -30,4 +32,5 @@ module.exports = mongoose.model("Member", new mongoose.Schema({
|
||||||
endDate: null,
|
endDate: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
|
|
26
base/User.js
26
base/User.js
|
@ -1,5 +1,5 @@
|
||||||
const mongoose = require("mongoose"),
|
import { Schema, model } from "mongoose";
|
||||||
Canvas = require("@napi-rs/canvas");
|
import { createCanvas, loadImage } from "@napi-rs/canvas";
|
||||||
|
|
||||||
const genToken = () => {
|
const genToken = () => {
|
||||||
let token = "";
|
let token = "";
|
||||||
|
@ -9,7 +9,7 @@ const genToken = () => {
|
||||||
return token;
|
return token;
|
||||||
};
|
};
|
||||||
|
|
||||||
const userSchema = new mongoose.Schema({
|
const userSchema = new Schema({
|
||||||
id: { type: String },
|
id: { type: String },
|
||||||
|
|
||||||
rep: { type: Number, default: 0 },
|
rep: { type: Number, default: 0 },
|
||||||
|
@ -88,17 +88,17 @@ const userSchema = new mongoose.Schema({
|
||||||
});
|
});
|
||||||
|
|
||||||
userSchema.method("getAchievements", async function () {
|
userSchema.method("getAchievements", async function () {
|
||||||
const canvas = Canvas.createCanvas(1800, 250),
|
const canvas = createCanvas(1800, 250),
|
||||||
ctx = canvas.getContext("2d");
|
ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
const images = [
|
const images = [
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.work.achieved ? "_colored" : ""}1.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.work.achieved ? "_colored" : ""}1.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.firstCommand.achieved ? "_colored" : ""}2.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.firstCommand.achieved ? "_colored" : ""}2.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.married.achieved ? "_colored" : ""}3.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.married.achieved ? "_colored" : ""}3.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.slots.achieved ? "_colored" : ""}4.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.slots.achieved ? "_colored" : ""}4.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.tip.achieved ? "_colored" : ""}5.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.tip.achieved ? "_colored" : ""}5.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.rep.achieved ? "_colored" : ""}6.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.rep.achieved ? "_colored" : ""}6.png`),
|
||||||
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.invite.achieved ? "_colored" : ""}7.png`),
|
await loadImage(`./assets/img/achievements/achievement${this.achievements.invite.achieved ? "_colored" : ""}7.png`),
|
||||||
];
|
];
|
||||||
let dim = 0;
|
let dim = 0;
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ userSchema.method("getAchievements", async function () {
|
||||||
dim += 200;
|
dim += 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (await canvas.encode("png"));
|
return await canvas.encode("png");
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = mongoose.model("User", userSchema);
|
export default model("User", userSchema);
|
||||||
|
|
|
@ -103,7 +103,8 @@ class Config extends BaseCommand {
|
||||||
? interaction.translate("administration/config:WELCOME_CONTENT", {
|
? interaction.translate("administration/config:WELCOME_CONTENT", {
|
||||||
channel: `<#${guildData.plugins.welcome.channel}>`,
|
channel: `<#${guildData.plugins.welcome.channel}>`,
|
||||||
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||||
}) : interaction.translate("common:DISABLED"),
|
})
|
||||||
|
: interaction.translate("common:DISABLED"),
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -112,7 +113,8 @@ class Config extends BaseCommand {
|
||||||
? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
||||||
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
||||||
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||||
}) : interaction.translate("common:DISABLED"),
|
})
|
||||||
|
: interaction.translate("common:DISABLED"),
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -125,19 +127,22 @@ class Config extends BaseCommand {
|
||||||
(guildData.plugins.warnsSanctions.kick
|
(guildData.plugins.warnsSanctions.kick
|
||||||
? interaction.translate("administration/config:KICK_CONTENT", {
|
? interaction.translate("administration/config:KICK_CONTENT", {
|
||||||
count: guildData.plugins.warnsSanctions.kick,
|
count: guildData.plugins.warnsSanctions.kick,
|
||||||
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) +
|
})
|
||||||
|
: interaction.translate("administration/config:KICK_NOT_DEFINED")) +
|
||||||
"\n" +
|
"\n" +
|
||||||
(guildData.plugins.warnsSanctions.ban
|
(guildData.plugins.warnsSanctions.ban
|
||||||
? interaction.translate("administration/config:BAN_CONTENT", {
|
? interaction.translate("administration/config:BAN_CONTENT", {
|
||||||
count: guildData.plugins.warnsSanctions.ban,
|
count: guildData.plugins.warnsSanctions.ban,
|
||||||
}) : interaction.translate("administration/config:BAN_NOT_DEFINED")),
|
})
|
||||||
|
: interaction.translate("administration/config:BAN_NOT_DEFINED")),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
|
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
|
||||||
value: guildData.plugins.automod.enabled
|
value: guildData.plugins.automod.enabled
|
||||||
? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
||||||
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`),
|
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`),
|
||||||
}) : interaction.translate("common:DISABLED"),
|
})
|
||||||
|
: interaction.translate("common:DISABLED"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: interaction.translate("administration/config:MONITORING_CHANNELS"),
|
name: interaction.translate("administration/config:MONITORING_CHANNELS"),
|
||||||
|
@ -156,10 +161,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: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`,
|
`${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})`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -215,7 +216,7 @@ async function changeSetting(interaction, setting, state, channel) {
|
||||||
content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
} else
|
} else {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: ${
|
content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: ${
|
||||||
data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`
|
data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`
|
||||||
|
@ -223,6 +224,7 @@ async function changeSetting(interaction, setting, state, channel) {
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
data.plugins[setting] = null;
|
data.plugins[setting] = null;
|
||||||
|
@ -245,7 +247,7 @@ async function changeSetting(interaction, setting, state, channel) {
|
||||||
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
} else
|
} else {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${
|
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${
|
||||||
data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`
|
data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`
|
||||||
|
@ -254,6 +256,7 @@ async function changeSetting(interaction, setting, state, channel) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Config;
|
module.exports = Config;
|
||||||
|
|
|
@ -91,7 +91,6 @@ class Stats extends BaseCommand {
|
||||||
{
|
{
|
||||||
name: client.customEmojis.link + " " + interaction.translate("general/stats:LINKS_TITLE"),
|
name: client.customEmojis.link + " " + interaction.translate("general/stats:LINKS_TITLE"),
|
||||||
value: interaction.translate("misc:STATS_FOOTER", {
|
value: interaction.translate("misc:STATS_FOOTER", {
|
||||||
dashboardLink: client.config.dashboard.domain,
|
|
||||||
supportLink: "https://discord.gg/Ptkj2n9nzZ",
|
supportLink: "https://discord.gg/Ptkj2n9nzZ",
|
||||||
inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] }),
|
inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] }),
|
||||||
owner: client.config.owner.id,
|
owner: client.config.owner.id,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const config = {
|
export default {
|
||||||
/* The token of your Discord Bot */
|
/* The token of your Discord Bot */
|
||||||
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||||
/* UserID of your Discord Bot */
|
/* UserID of your Discord Bot */
|
||||||
|
@ -22,14 +22,14 @@ export const config = {
|
||||||
invite: "https://discord.gg/discord", // Invite link to the support server
|
invite: "https://discord.gg/discord", // Invite link to the support server
|
||||||
},
|
},
|
||||||
/* Dashboard configuration */
|
/* Dashboard configuration */
|
||||||
dashboard: {
|
/* dashboard: {
|
||||||
enabled: false, // Whether the dashboard is enabled or not
|
enabled: false, // Whether the dashboard is enabled or not
|
||||||
maintanceKey: "letmein", // Maintance key
|
maintanceKey: "letmein", // Maintance key
|
||||||
port: 80, // Dashboard port
|
port: 80, // Dashboard port
|
||||||
domain: "http://localhost", // The base URL of the dashboard without / at the end
|
domain: "http://localhost", // The base URL of the dashboard without / at the end
|
||||||
secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", // Your Bot's Client Secret
|
secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", // Your Bot's Client Secret
|
||||||
logs: "123456789098765432", // The channel ID for logs
|
logs: "123456789098765432", // The channel ID for logs
|
||||||
},
|
}, */
|
||||||
/* Embeds defaults */
|
/* Embeds defaults */
|
||||||
embed: {
|
embed: {
|
||||||
color: "#00FF00", // Color
|
color: "#00FF00", // Color
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 42cb44000f844f17b0d9e12e15a45ab60f3dcdb7
|
|
|
@ -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, // <Rate Limiter Store> - 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: [
|
|
||||||
"<br>",
|
|
||||||
"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.",
|
|
||||||
"<br>",
|
|
||||||
`Come back to us later or join our <a href="${client.config.support.invite}">Discord Support Server</a>`,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
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 <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
|
|
||||||
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}`);
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -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",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
|
@ -18,7 +18,7 @@ export default [
|
||||||
rules: {
|
rules: {
|
||||||
"arrow-body-style": ["error", "as-needed"],
|
"arrow-body-style": ["error", "as-needed"],
|
||||||
camelcase: "error",
|
camelcase: "error",
|
||||||
curly: "error",
|
curly: ["error", "multi-line"],
|
||||||
eqeqeq: ["error", "always"],
|
eqeqeq: ["error", "always"],
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { InteractionType } = require("discord.js");
|
import { InteractionType } from "discord.js";
|
||||||
const BaseEvent = require("../base/BaseEvent");
|
import BaseEvent from "../base/BaseEvent";
|
||||||
|
|
||||||
class CommandHandler extends BaseEvent {
|
class CommandHandler extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -33,12 +33,10 @@ class CommandHandler extends BaseEvent {
|
||||||
if (interaction.type !== InteractionType.ApplicationCommand || !interaction.isCommand()) return;
|
if (interaction.type !== InteractionType.ApplicationCommand || !interaction.isCommand()) return;
|
||||||
|
|
||||||
// IAT Guild Command Check
|
// IAT Guild Command Check
|
||||||
if (command?.dirname.includes("IAT") && interaction.guildId !== "1039187019957555252")
|
if (command?.dirname.includes("IAT") && interaction.guildId !== "1039187019957555252") return interaction.reply({ content: "IAT only", ephemeral: true });
|
||||||
return interaction.reply({ content: "IAT only", ephemeral: true });
|
|
||||||
|
|
||||||
// Owner-only command check
|
// Owner-only command check
|
||||||
if (command.ownerOnly && interaction.user.id !== client.config.owner.id)
|
if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { ephemeral: true });
|
||||||
return interaction.error("misc:OWNER_ONLY", null, { ephemeral: true });
|
|
||||||
|
|
||||||
// First command achievement check
|
// First command achievement check
|
||||||
const { firstCommand } = interaction.data.user.achievements;
|
const { firstCommand } = interaction.data.user.achievements;
|
||||||
|
@ -68,4 +66,4 @@ class CommandHandler extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = CommandHandler;
|
export default CommandHandler;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class guildBanAdd extends BaseEvent {
|
class guildBanAdd extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -26,8 +26,10 @@ class guildBanAdd extends BaseEvent {
|
||||||
await ban.user.send({
|
await ban.user.send({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
});
|
});
|
||||||
} catch (e) { /**/ }
|
} catch {
|
||||||
|
/**/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = guildBanAdd;
|
export default guildBanAdd;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class GuildCreate extends BaseEvent {
|
class GuildCreate extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -62,12 +62,13 @@ class GuildCreate extends BaseEvent {
|
||||||
|
|
||||||
const logChannel = client.channels.cache.get(client.config.support.logs);
|
const logChannel = client.channels.cache.get(client.config.support.logs);
|
||||||
|
|
||||||
if (logChannel)
|
if (logChannel) {
|
||||||
await logChannel.send({
|
await logChannel.send({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GuildCreate;
|
export default GuildCreate;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class GuildDelete extends BaseEvent {
|
class GuildDelete extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -25,13 +25,13 @@ class GuildDelete extends BaseEvent {
|
||||||
|
|
||||||
const logChannel = client.channels.cache.get(client.config.support.logs);
|
const logChannel = client.channels.cache.get(client.config.support.logs);
|
||||||
|
|
||||||
if (logChannel)
|
if (logChannel) {
|
||||||
await logChannel.send({
|
await logChannel.send({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
});
|
});
|
||||||
else client.logger.warn(`Log channel not found for guild deletion: ${guild.name}`);
|
} else client.logger.warn(`Log channel not found for guild deletion: ${guild.name}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GuildDelete;
|
export default GuildDelete;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class GuildMemberAdd extends BaseEvent {
|
class GuildMemberAdd extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -46,4 +46,4 @@ class GuildMemberAdd extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GuildMemberAdd;
|
export default GuildMemberAdd;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class GuildMemberRemove extends BaseEvent {
|
class GuildMemberRemove extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -37,4 +37,4 @@ class GuildMemberRemove extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GuildMemberRemove;
|
export default GuildMemberRemove;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class GuildMemberUpdate extends BaseEvent {
|
class GuildMemberUpdate extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -44,4 +44,4 @@ class GuildMemberUpdate extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GuildMemberUpdate;
|
export default GuildMemberUpdate;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { PermissionsBitField, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
|
import { PermissionsBitField, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
|
||||||
const BaseEvent = require("../base/BaseEvent");
|
import BaseEvent from "../base/BaseEvent";
|
||||||
|
|
||||||
const xpCooldown = {};
|
const xpCooldown = {};
|
||||||
|
|
||||||
|
@ -69,8 +69,7 @@ class MessageCreate extends BaseEvent {
|
||||||
|
|
||||||
if (msg.content) embed.addFields([{ name: message.translate("misc:QUOTE_CONTENT"), value: msg.content }]);
|
if (msg.content) embed.addFields([{ name: message.translate("misc:QUOTE_CONTENT"), value: msg.content }]);
|
||||||
if (msg.attachments.size > 0) {
|
if (msg.attachments.size > 0) {
|
||||||
if (msg.attachments.find(a => a.contentType.includes("image/")))
|
if (msg.attachments.find(a => a.contentType.includes("image/"))) embed.setImage(msg.attachments.find(a => a.contentType.includes("image/")).url);
|
||||||
embed.setImage(msg.attachments.find(a => a.contentType.includes("image/")).url);
|
|
||||||
|
|
||||||
embed.addFields([
|
embed.addFields([
|
||||||
{
|
{
|
||||||
|
@ -160,4 +159,4 @@ class MessageCreate extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = MessageCreate;
|
export default MessageCreate;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class messageDelete extends BaseEvent {
|
class messageDelete extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -40,4 +40,4 @@ class messageDelete extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = messageDelete;
|
export default messageDelete;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const BaseEvent = require("../../base/BaseEvent");
|
import BaseEvent from "../../base/BaseEvent";
|
||||||
|
|
||||||
class messageUpdate extends BaseEvent {
|
class messageUpdate extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -42,4 +42,4 @@ class messageUpdate extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = messageUpdate;
|
export default messageUpdate;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { ActivityType } = require("discord.js");
|
import { ActivityType } from "discord.js";
|
||||||
const BaseEvent = require("../base/BaseEvent");
|
import BaseEvent from "../base/BaseEvent";
|
||||||
|
|
||||||
class Ready extends BaseEvent {
|
class Ready extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -28,8 +28,6 @@ class Ready extends BaseEvent {
|
||||||
const checkReminds = require("../helpers/checkReminds");
|
const checkReminds = require("../helpers/checkReminds");
|
||||||
checkReminds.init(client);
|
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(`Loaded a total of ${commands.length} command(s).`);
|
||||||
client.logger.ready(`${client.user.getUsername()}, ready to serve ${users} members in ${servers} servers.`);
|
client.logger.ready(`${client.user.getUsername()}, ready to serve ${users} members in ${servers} servers.`);
|
||||||
console.timeEnd("botReady");
|
console.timeEnd("botReady");
|
||||||
|
@ -63,4 +61,4 @@ class Ready extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Ready;
|
export default Ready;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { ButtonBuilder, ActionRowBuilder, ButtonStyle, ChannelType, PermissionsBitField } = require("discord.js");
|
import { ButtonBuilder, ActionRowBuilder, ButtonStyle, ChannelType, PermissionsBitField } from "discord.js";
|
||||||
const BaseEvent = require("../base/BaseEvent");
|
import BaseEvent from "../base/BaseEvent";
|
||||||
|
|
||||||
class CommandHandler extends BaseEvent {
|
class CommandHandler extends BaseEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -60,9 +60,13 @@ class CommandHandler extends BaseEvent {
|
||||||
});
|
});
|
||||||
|
|
||||||
await logChannel.send({ embeds: [logEmbed] });
|
await logChannel.send({ embeds: [logEmbed] });
|
||||||
await interaction.success("tickets/createticketembed:TICKET_CREATED", {
|
await interaction.success(
|
||||||
|
"tickets/createticketembed:TICKET_CREATED",
|
||||||
|
{
|
||||||
channel: channel.toString(),
|
channel: channel.toString(),
|
||||||
}, { ephemeral: true });
|
},
|
||||||
|
{ ephemeral: true },
|
||||||
|
);
|
||||||
|
|
||||||
await channel.send(`<@${interaction.user.id}>`);
|
await channel.send(`<@${interaction.user.id}>`);
|
||||||
|
|
||||||
|
@ -75,14 +79,8 @@ class CommandHandler extends BaseEvent {
|
||||||
description: interaction.translate("tickets/createticketembed:TICKET_CREATED_DESC"),
|
description: interaction.translate("tickets/createticketembed:TICKET_CREATED_DESC"),
|
||||||
});
|
});
|
||||||
|
|
||||||
const closeButton = new ButtonBuilder()
|
const closeButton = new ButtonBuilder().setCustomId("close_ticket").setLabel(interaction.translate("tickets/closeticket:CLOSE_TICKET")).setStyle(ButtonStyle.Danger);
|
||||||
.setCustomId("close_ticket")
|
const transcriptButton = new ButtonBuilder().setCustomId("transcript_ticket").setLabel(interaction.translate("tickets/closeticket:TRANSCRIPT_TICKET")).setStyle(ButtonStyle.Secondary);
|
||||||
.setLabel(interaction.translate("tickets/closeticket:CLOSE_TICKET"))
|
|
||||||
.setStyle(ButtonStyle.Danger);
|
|
||||||
const transcriptButton = new ButtonBuilder()
|
|
||||||
.setCustomId("transcript_ticket")
|
|
||||||
.setLabel(interaction.translate("tickets/closeticket:TRANSCRIPT_TICKET"))
|
|
||||||
.setStyle(ButtonStyle.Secondary);
|
|
||||||
const row = new ActionRowBuilder().addComponents(closeButton, transcriptButton);
|
const row = new ActionRowBuilder().addComponents(closeButton, transcriptButton);
|
||||||
|
|
||||||
guildData.plugins.tickets.count++;
|
guildData.plugins.tickets.count++;
|
||||||
|
@ -135,14 +133,18 @@ class CommandHandler extends BaseEvent {
|
||||||
});
|
});
|
||||||
transcript += "---- TICKET CLOSED ----\n";
|
transcript += "---- TICKET CLOSED ----\n";
|
||||||
|
|
||||||
if (transcriptionLogs !== null) interaction.guild.channels.cache.get(transcriptionLogs).send({ content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: `<#${interaction.channelId}>` }), files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }] });
|
if (transcriptionLogs !== null) {
|
||||||
|
interaction.guild.channels.cache
|
||||||
|
.get(transcriptionLogs)
|
||||||
|
.send({ content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: `<#${interaction.channelId}>` }), files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }] });
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await interaction.user.send({
|
await interaction.user.send({
|
||||||
content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: interaction.channel.name }),
|
content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: interaction.channel.name }),
|
||||||
files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }],
|
files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }],
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch {
|
||||||
interaction.followUp({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
interaction.followUp({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +183,7 @@ class CommandHandler extends BaseEvent {
|
||||||
content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: `<#${interaction.channelId}>` }),
|
content: interaction.translate("tickets/closeticket:TRANSCRIPT", { channel: `<#${interaction.channelId}>` }),
|
||||||
files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }],
|
files: [{ attachment: Buffer.from(transcript), name: `${interaction.channel.name}.txt` }],
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch {
|
||||||
interaction.followUp({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
interaction.followUp({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
||||||
}
|
}
|
||||||
} else return;
|
} else return;
|
||||||
|
@ -189,4 +191,4 @@ class CommandHandler extends BaseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = CommandHandler;
|
export default CommandHandler;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { CronJob } = require("cron");
|
import { CronJob } from "cron";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -61,5 +61,9 @@ async function checkBirthdays(client) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.init = async client => new CronJob("0 5 * * *", checkBirthdays(client), null, true, "Europe/Moscow");
|
export async function init(client) {
|
||||||
module.exports.run = async client => await checkBirthdays(client);
|
new CronJob("0 5 * * *", checkBirthdays(client), null, true, "Europe/Moscow");
|
||||||
|
}
|
||||||
|
export async function run(client) {
|
||||||
|
await checkBirthdays(client);
|
||||||
|
}
|
||||||
|
|
|
@ -56,5 +56,11 @@ async function checkReminds(client) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.init = async client => setInterval(async () => await checkReminds(client), 1000);
|
export async function init(client) {
|
||||||
module.exports.run = async client => await checkReminds(client);
|
setInterval(async () => {
|
||||||
|
await checkReminds(client);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
export async function run(client) {
|
||||||
|
await checkReminds(client);
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Thanks Stackoverflow <3
|
// Thanks Stackoverflow <3
|
||||||
|
|
||||||
function setDaysTimeout(callback, days) {
|
function setDaysTimeout(callback, days) {
|
||||||
// 86400 seconds in a day
|
// 86400 seconds in a day
|
||||||
const msInDay = 86400 * 1000;
|
const msInDay = 86400 * 1000;
|
||||||
|
@ -19,7 +18,7 @@ function setDaysTimeout(callback, days) {
|
||||||
*
|
*
|
||||||
* @param {import("../base/Client")} client
|
* @param {import("../base/Client")} client
|
||||||
*/
|
*/
|
||||||
module.exports.init = async function (client) {
|
export async function init(client) {
|
||||||
setDaysTimeout(async () => {
|
setDaysTimeout(async () => {
|
||||||
const timestamp = Date.now() + 29 * 24 * 60 * 60 * 1000; // 29 days
|
const timestamp = Date.now() + 29 * 24 * 60 * 60 * 1000; // 29 days
|
||||||
const members = client.membersData.find({ transactions: { $gt: [] } });
|
const members = client.membersData.find({ transactions: { $gt: [] } });
|
||||||
|
@ -66,4 +65,4 @@ module.exports.init = async function (client) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 30);
|
}, 30);
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { Message, BaseInteraction, User, GuildMember } = require("discord.js");
|
import { Message, BaseInteraction, User, GuildMember } from "discord.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,43 +1,42 @@
|
||||||
const moment = require("moment");
|
import moment from "moment";
|
||||||
|
|
||||||
module.exports = {
|
/**
|
||||||
/**
|
|
||||||
* Asynchronously iterates over a collection and executes a callback function for each item.
|
* Asynchronously iterates over a collection and executes a callback function for each item.
|
||||||
*
|
*
|
||||||
* @param {any[]} collection - The collection to iterate over.
|
* @param {any[]} collection - The collection to iterate over.
|
||||||
* @param {(item: any) => Promise<void>} callback - The async callback function to execute for each item in the collection.
|
* @param {(item: any) => Promise<void>} callback - The async callback function to execute for each item in the collection.
|
||||||
* @returns {Promise<void>} A promise that resolves when all items in the collection have been processed.
|
* @returns {Promise<void>} A promise that resolves when all items in the collection have been processed.
|
||||||
*/
|
*/
|
||||||
async asyncForEach(collection, callback) {
|
export async function asyncForEach(collection, callback) {
|
||||||
const allPromises = collection.map(async key => {
|
const allPromises = collection.map(async key => {
|
||||||
await callback(key);
|
await callback(key);
|
||||||
});
|
});
|
||||||
|
|
||||||
return await Promise.all(allPromises);
|
return await Promise.all(allPromises);
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts an array by the specified key in ascending order.
|
* Sorts an array by the specified key in ascending order.
|
||||||
*
|
*
|
||||||
* @param {any[]} array - The array to sort.
|
* @param {any[]} array - The array to sort.
|
||||||
* @param {string} key - The key to sort the array by.
|
* @param {string} key - The key to sort the array by.
|
||||||
* @returns {any[]} The sorted array.
|
* @returns {any[]} The sorted array.
|
||||||
*/
|
*/
|
||||||
sortByKey(array, key) {
|
export function sortByKey(array, key) {
|
||||||
return array.sort(function (a, b) {
|
return array.sort(function (a, b) {
|
||||||
const x = a[key];
|
const x = a[key];
|
||||||
const y = b[key];
|
const y = b[key];
|
||||||
return x < y ? 1 : x > y ? -1 : 0;
|
return x < y ? 1 : x > y ? -1 : 0;
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffles the elements of the provided array in-place.
|
* Shuffles the elements of the provided array in-place.
|
||||||
*
|
*
|
||||||
* @param {any[]} pArray - The array to shuffle.
|
* @param {any[]} pArray - The array to shuffle.
|
||||||
* @returns {any[]} The shuffled array.
|
* @returns {any[]} The shuffled array.
|
||||||
*/
|
*/
|
||||||
shuffle(pArray) {
|
export function shuffle(pArray) {
|
||||||
const array = [];
|
const array = [];
|
||||||
|
|
||||||
pArray.forEach(element => array.push(element));
|
pArray.forEach(element => array.push(element));
|
||||||
|
@ -49,30 +48,28 @@ module.exports = {
|
||||||
while (currentIndex !== 0) {
|
while (currentIndex !== 0) {
|
||||||
randomIndex = Math.floor(Math.random() * currentIndex);
|
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||||
currentIndex -= 1;
|
currentIndex -= 1;
|
||||||
|
|
||||||
temporaryValue = array[currentIndex];
|
temporaryValue = array[currentIndex];
|
||||||
array[currentIndex] = array[randomIndex];
|
array[currentIndex] = array[randomIndex];
|
||||||
array[randomIndex] = temporaryValue;
|
array[randomIndex] = temporaryValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a random integer between the specified minimum and maximum values (inclusive).
|
* Generates a random integer between the specified minimum and maximum values (inclusive).
|
||||||
*
|
*
|
||||||
* @param {number} [min=0] - The minimum value (inclusive).
|
* @param {number} [min=0] - The minimum value (inclusive).
|
||||||
* @param {number} [max=100] - The maximum value (inclusive).
|
* @param {number} [max=100] - The maximum value (inclusive).
|
||||||
* @returns {number} A random integer between min and max.
|
* @returns {number} A random integer between min and max.
|
||||||
*/
|
*/
|
||||||
randomNum(min = 0, max = 100) {
|
export function randomNum(min = 0, max = 100) {
|
||||||
min = Math.floor(min);
|
min = Math.floor(min);
|
||||||
max = Math.floor(max);
|
max = Math.floor(max);
|
||||||
|
|
||||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||||
},
|
}
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* Formats a date for the specified client and locale.
|
* Formats a date for the specified client and locale.
|
||||||
*
|
*
|
||||||
* @param {Object} client - The client object containing language data.
|
* @param {Object} client - The client object containing language data.
|
||||||
|
@ -81,14 +78,12 @@ module.exports = {
|
||||||
* @param {string} [locale=client.defaultLanguage.name] - The locale to use for formatting the date.
|
* @param {string} [locale=client.defaultLanguage.name] - The locale to use for formatting the date.
|
||||||
* @returns {string} The formatted date.
|
* @returns {string} The formatted date.
|
||||||
*/
|
*/
|
||||||
printDate(client, date, format = null, locale = client.defaultLanguage.name) {
|
export function printDate(client, date, format = null, locale = client.defaultLanguage.name) {
|
||||||
const languageData = client.languages.find(language => language.name === locale);
|
const languageData = client.languages.find(language => language.name === locale);
|
||||||
if (format === "" || format === null) format = languageData.defaultMomentFormat;
|
if (format === "" || format === null) format = languageData.defaultMomentFormat;
|
||||||
|
|
||||||
return moment(new Date(date)).locale(languageData.moment).format(format);
|
return moment(new Date(date)).locale(languageData.moment).format(format);
|
||||||
},
|
}
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* Formats a time value relative to the current time.
|
* Formats a time value relative to the current time.
|
||||||
*
|
*
|
||||||
* @param {Object} client - The client object containing language data.
|
* @param {Object} client - The client object containing language data.
|
||||||
|
@ -98,14 +93,13 @@ module.exports = {
|
||||||
* @param {string} [locale=client.defaultLanguage.name] - The locale to use for formatting the time.
|
* @param {string} [locale=client.defaultLanguage.name] - The locale to use for formatting the time.
|
||||||
* @returns {string} The formatted time value.
|
* @returns {string} The formatted time value.
|
||||||
*/
|
*/
|
||||||
convertTime(client, time, type = false, prefix = true, locale = client.defaultLanguage.name) {
|
export function convertTime(client, time, type = false, prefix = true, locale = client.defaultLanguage.name) {
|
||||||
const languageData = client.languages.find(language => language.name === locale);
|
const languageData = client.languages.find(language => language.name === locale);
|
||||||
const m = moment(time).locale(languageData.moment);
|
const m = moment(time).locale(languageData.moment);
|
||||||
|
|
||||||
return type ? m.toNow(!prefix) : m.fromNow(!prefix);
|
return type ? m.toNow(!prefix) : m.fromNow(!prefix);
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the appropriate noun form based on the given number and noun forms.
|
* Generates the appropriate noun form based on the given number and noun forms.
|
||||||
*
|
*
|
||||||
* @param {number} number - The number to use for determining the noun form.
|
* @param {number} number - The number to use for determining the noun form.
|
||||||
|
@ -114,19 +108,17 @@ module.exports = {
|
||||||
* @param {string} five - The noun form for the plural case.
|
* @param {string} five - The noun form for the plural case.
|
||||||
* @returns {string} The appropriate noun form based on the given number.
|
* @returns {string} The appropriate noun form based on the given number.
|
||||||
*/
|
*/
|
||||||
getNoun(number, one, two, five) {
|
export function getNoun(number, one, two, five) {
|
||||||
let n = Math.abs(number);
|
let n = Math.abs(number);
|
||||||
n %= 100;
|
n %= 100;
|
||||||
if (n >= 5 && n <= 20) return five;
|
if (n >= 5 && n <= 20) return five;
|
||||||
n %= 10;
|
n %= 10;
|
||||||
|
|
||||||
if (n === 1) return one;
|
if (n === 1) return one;
|
||||||
if (n >= 2 && n <= 4) return two;
|
if (n >= 2 && n <= 4) return two;
|
||||||
|
|
||||||
return five;
|
return five;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to apply text on a canvas with dynamic font size based on the width constraint.
|
* Function to apply text on a canvas with dynamic font size based on the width constraint.
|
||||||
*
|
*
|
||||||
* @param {import("@napi-rs/canvas").Canvas} canvas - The canvas object where the text will be applied.
|
* @param {import("@napi-rs/canvas").Canvas} canvas - The canvas object where the text will be applied.
|
||||||
|
@ -137,11 +129,9 @@ module.exports = {
|
||||||
*
|
*
|
||||||
* @return {string} - The final calculated font size in a format '<size>px <family>'.
|
* @return {string} - The final calculated font size in a format '<size>px <family>'.
|
||||||
*/
|
*/
|
||||||
applyText(canvas, text, defaultFontSize, width, font) {
|
export function applyText(canvas, text, defaultFontSize, width, font) {
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
do ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
|
do ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
|
||||||
while (ctx.measureText(text).width > width);
|
while (ctx.measureText(text).width > width);
|
||||||
|
|
||||||
return ctx.font;
|
return ctx.font;
|
||||||
},
|
}
|
||||||
};
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
const i18next = require("i18next"),
|
import { use, init, getFixedT } from "i18next";
|
||||||
Backend = require("i18next-fs-backend"),
|
import Backend from "i18next-fs-backend";
|
||||||
path = require("path"),
|
import { join, resolve } from "path";
|
||||||
fs = require("fs").promises;
|
import { promises as fs } from "fs";
|
||||||
|
|
||||||
async function walkDirectory(dir, namespaces = [], folderName = "") {
|
async function walkDirectory(dir, namespaces = [], folderName = "") {
|
||||||
const files = await fs.readdir(dir);
|
const files = await fs.readdir(dir);
|
||||||
|
|
||||||
const languages = [];
|
const languages = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const stat = await fs.stat(path.join(dir, file));
|
const stat = await fs.stat(join(dir, file));
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
const isLanguage = file.includes("-");
|
const isLanguage = file.includes("-");
|
||||||
if (isLanguage) languages.push(file);
|
if (isLanguage) languages.push(file);
|
||||||
|
|
||||||
const folder = await walkDirectory(path.join(dir, file), namespaces, isLanguage ? "" : `${file}/`);
|
const folder = await walkDirectory(join(dir, file), namespaces, isLanguage ? "" : `${file}/`);
|
||||||
|
|
||||||
namespaces = folder.namespaces;
|
namespaces = folder.namespaces;
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,16 +27,16 @@ async function walkDirectory(dir, namespaces = [], folderName = "") {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async () => {
|
export default async () => {
|
||||||
const options = {
|
const options = {
|
||||||
loadPath: path.resolve(__dirname, "../languages/{{lng}}/{{ns}}.json"),
|
loadPath: resolve(__dirname, "../languages/{{lng}}/{{ns}}.json"),
|
||||||
};
|
};
|
||||||
|
|
||||||
const { namespaces, languages } = await walkDirectory(path.resolve(__dirname, "../languages/"));
|
const { namespaces, languages } = await walkDirectory(resolve(__dirname, "../languages/"));
|
||||||
|
|
||||||
i18next.use(Backend);
|
use(Backend);
|
||||||
|
|
||||||
await i18next.init({
|
await init({
|
||||||
backend: options,
|
backend: options,
|
||||||
debug: false,
|
debug: false,
|
||||||
fallbackLng: "en-US",
|
fallbackLng: "en-US",
|
||||||
|
@ -47,5 +47,5 @@ module.exports = async () => {
|
||||||
preload: languages,
|
preload: languages,
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Map(languages.map(item => [item, i18next.getFixedT(item)]));
|
return new Map(languages.map(item => [item, getFixedT(item)]));
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { bgBlue, black, green } = require("chalk");
|
import { bgBlue, black, green } from "chalk";
|
||||||
|
|
||||||
function dateTimePad(value, digits) {
|
function dateTimePad(value, digits) {
|
||||||
let number = value;
|
let number = value;
|
||||||
|
@ -25,28 +25,28 @@ function format(tDate) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = class Logger {
|
export default {
|
||||||
static log(content) {
|
log(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${bgBlue("LOG")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${bgBlue("LOG")} ${content}`);
|
||||||
}
|
},
|
||||||
|
|
||||||
static warn(content) {
|
warn(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgYellow("WARN")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgYellow("WARN")} ${content}`);
|
||||||
}
|
},
|
||||||
|
|
||||||
static error(content) {
|
error(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgRed("ERROR")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgRed("ERROR")} ${content}`);
|
||||||
}
|
},
|
||||||
|
|
||||||
static debug(content) {
|
debug(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${green("DEBUG")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${green("DEBUG")} ${content}`);
|
||||||
}
|
},
|
||||||
|
|
||||||
static cmd(content) {
|
cmd(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgWhite("CMD")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgWhite("CMD")} ${content}`);
|
||||||
}
|
},
|
||||||
|
|
||||||
static ready(content) {
|
ready(content) {
|
||||||
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgGreen("READY")} ${content}`);
|
return console.log(`[${format(new Date(Date.now()))}]: ${black.bgGreen("READY")} ${content}`);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Thanks to simply-djs for this =)
|
// Thanks to simply-djs for this =)
|
||||||
// TODO: Refactor this please...
|
// TODO: Refactor this please...
|
||||||
|
|
||||||
const { ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentType } = require("discord.js");
|
import { ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentType } from "discord.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
||||||
|
@ -15,7 +15,7 @@ const { ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentType } = require(
|
||||||
* @param {string} options.idleEmoji Emoji for "nothing"
|
* @param {string} options.idleEmoji Emoji for "nothing"
|
||||||
* @returns {Promise<import("discord.js").User>}
|
* @returns {Promise<import("discord.js").User>}
|
||||||
*/
|
*/
|
||||||
async function tictactoe(interaction, options = {}) {
|
export async function tictactoe(interaction, options = {}) {
|
||||||
// eslint-disable-next-line no-async-promise-executor
|
// eslint-disable-next-line no-async-promise-executor
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
try {
|
try {
|
||||||
|
@ -25,42 +25,48 @@ async function tictactoe(interaction, options = {}) {
|
||||||
if (interaction.commandId) {
|
if (interaction.commandId) {
|
||||||
opponent = interaction.options.getUser(options.userSlash || "user");
|
opponent = interaction.options.getUser(options.userSlash || "user");
|
||||||
|
|
||||||
if (!opponent)
|
if (!opponent) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("fun/tictactoe:NO_USER"),
|
content: interaction.translate("fun/tictactoe:NO_USER"),
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (opponent.bot)
|
if (opponent.bot) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("fun/tictactoe:BOT_USER"),
|
content: interaction.translate("fun/tictactoe:BOT_USER"),
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (opponent.id == (interaction.user ? interaction.user : interaction.author).id)
|
if (opponent.id === (interaction.user ? interaction.user : interaction.author).id) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("misc:CANT_YOURSELF"),
|
content: interaction.translate("misc:CANT_YOURSELF"),
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else if (!interaction.commandId) {
|
} else if (!interaction.commandId) {
|
||||||
opponent = interaction.mentions.members.first()?.user;
|
opponent = interaction.mentions.members.first()?.user;
|
||||||
|
|
||||||
if (!opponent)
|
if (!opponent) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("fun/tictactoe:NO_USER"),
|
content: interaction.translate("fun/tictactoe:NO_USER"),
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (opponent.bot)
|
if (opponent.bot) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("fun/tictactoe:BOT_USER"),
|
content: interaction.translate("fun/tictactoe:BOT_USER"),
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (opponent.id === interaction.member.id)
|
if (opponent.id === interaction.member.id) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: interaction.translate("misc:CANT_YOURSELF"),
|
content: interaction.translate("misc:CANT_YOURSELF"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const footer = options.embedFooter || client.config.embed.footer,
|
const footer = options.embedFooter || client.config.embed.footer,
|
||||||
color = options.embedColor || client.config.embed.color,
|
color = options.embedColor || client.config.embed.color,
|
||||||
|
@ -97,25 +103,26 @@ async function tictactoe(interaction, options = {}) {
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async button => {
|
collector.on("collect", async button => {
|
||||||
if (button.user.id !== opponent.id)
|
if (button.user.id !== opponent.id) {
|
||||||
return button.reply({
|
return button.reply({
|
||||||
content: interaction.translate("fun/tictactoe:REQUEST_SEND", {
|
content: interaction.translate("fun/tictactoe:REQUEST_SEND", {
|
||||||
opponent: opponent.id,
|
opponent: opponent.id,
|
||||||
}),
|
}),
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (button.customId == "declinettt") {
|
if (button.customId === "declinettt") {
|
||||||
button.deferUpdate();
|
button.deferUpdate();
|
||||||
return collector.stop("decline");
|
return collector.stop("decline");
|
||||||
} else if (button.customId == "acceptttt") {
|
} else if (button.customId === "acceptttt") {
|
||||||
button.deferUpdate();
|
button.deferUpdate();
|
||||||
collector.stop();
|
collector.stop();
|
||||||
|
|
||||||
const fighters = [(interaction.user ? interaction.user : interaction.author).id, opponent.id].sort(() => (Math.random() > 0.5 ? 1 : -1));
|
const fighters = [(interaction.user ? interaction.user : interaction.author).id, opponent.id].sort(() => (Math.random() > 0.5 ? 1 : -1));
|
||||||
|
|
||||||
const x_emoji = options.xEmoji || "❌";
|
const xEmoji = options.xEmoji || "❌";
|
||||||
const o_emoji = options.oEmoji || "⭕";
|
const oEmoji = options.oEmoji || "⭕";
|
||||||
|
|
||||||
const dashmoji = options.idleEmoji || "➖";
|
const dashmoji = options.idleEmoji || "➖";
|
||||||
|
|
||||||
|
@ -175,32 +182,32 @@ async function tictactoe(interaction, options = {}) {
|
||||||
});
|
});
|
||||||
|
|
||||||
let msg;
|
let msg;
|
||||||
if (interaction.commandId)
|
if (interaction.commandId) {
|
||||||
msg = await interaction.editReply({
|
msg = await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
interaction.translate("fun/tictactoe:WAITING", {
|
interaction.translate("fun/tictactoe:WAITING", {
|
||||||
user: Args.userid,
|
user: Args.userid,
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
else if (!interaction.commandId)
|
} else if (!interaction.commandId) {
|
||||||
msg = await button.message.edit({
|
msg = await button.message.edit({
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
interaction.translate("fun/tictactoe:WAITING", {
|
interaction.translate("fun/tictactoe:WAITING", {
|
||||||
user: Args.userid,
|
user: Args.userid,
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await ttt(msg);
|
await ttt(msg);
|
||||||
|
|
||||||
// eslint-disable-next-line no-inner-declarations
|
|
||||||
async function ttt(m) {
|
async function ttt(m) {
|
||||||
Args.userid = fighters[Args.user];
|
Args.userid = fighters[Args.user];
|
||||||
const won = {
|
const won = {
|
||||||
|
@ -222,33 +229,32 @@ async function tictactoe(interaction, options = {}) {
|
||||||
const c = new ActionRowBuilder().addComponents([c1, c2, c3]);
|
const c = new ActionRowBuilder().addComponents([c1, c2, c3]);
|
||||||
const buttons = [a, b, c];
|
const buttons = [a, b, c];
|
||||||
|
|
||||||
if (Args.a1.emoji == o_emoji && Args.b1.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.b1.emoji === oEmoji && Args.c1.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.a2.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c2.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a2.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c2.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.a3.emoji == o_emoji && Args.b3.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a3.emoji === oEmoji && Args.b3.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.a1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.a3.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a3.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c1.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.a1.emoji == o_emoji && Args.a2.emoji == o_emoji && Args.a3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.a2.emoji === oEmoji && Args.a3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.b1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.b3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.b1.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.b3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (Args.c1.emoji == o_emoji && Args.c2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.c1.emoji === oEmoji && Args.c2.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (won["<:O_:863314110560993340>"] != false)
|
if (won["<:O_:863314110560993340>"] !== false) {
|
||||||
if (Args.user == 0) {
|
if (Args.user === 0) {
|
||||||
const won = await client.users.fetch(fighters[1]).catch(console.error);
|
const won = await client.users.fetch(fighters[1]).catch(console.error);
|
||||||
resolve(won);
|
resolve(won);
|
||||||
|
|
||||||
if (options.resultBtn === true)
|
if (options.resultBtn === true) {
|
||||||
return m
|
return m.edit({
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[1],
|
winner: fighters[1],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
components: buttons,
|
components: buttons,
|
||||||
|
|
||||||
|
@ -256,180 +262,179 @@ async function tictactoe(interaction, options = {}) {
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
interaction.translate("fun/tictactoe:WON", {
|
interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[1],
|
winner: fighters[1],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
else if (!options.resultBtn || options.resultBtn === false)
|
} else if (!options.resultBtn || options.resultBtn === false) {
|
||||||
return m
|
return m.edit({
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[1],
|
winner: fighters[1],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
|
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
`${interaction.translate("fun/tictactoe:WON", {
|
`${interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[1],
|
winner: fighters[1],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
})}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji
|
})}\n\`\`\`\n${Args.a1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji
|
.replace(xEmoji, "❌")}\n${Args.b1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji
|
.replace(xEmoji, "❌")}\n${Args.c1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
.replace(xEmoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
||||||
),
|
|
||||||
],
|
|
||||||
components: [],
|
|
||||||
});
|
|
||||||
} else if (Args.user == 1) {
|
|
||||||
const won = await client.users.fetch(fighters[0]).catch(console.error);
|
|
||||||
resolve(won);
|
|
||||||
|
|
||||||
if (options.resultBtn === true)
|
|
||||||
return m
|
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[0],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
components: buttons,
|
|
||||||
embeds: [
|
|
||||||
epm.setDescription(
|
|
||||||
interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[0],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
else if (!options.resultBtn || options.resultBtn === false)
|
|
||||||
return m
|
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[0],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
|
|
||||||
embeds: [
|
|
||||||
epm.setDescription(
|
|
||||||
`${interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[0],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
})}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
components: [],
|
components: [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else if (Args.user === 1) {
|
||||||
if (Args.a1.emoji == x_emoji && Args.b1.emoji == x_emoji && Args.c1.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.a2.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c2.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.a3.emoji == x_emoji && Args.b3.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.a1.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.a3.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c1.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.a1.emoji == x_emoji && Args.a2.emoji == x_emoji && Args.a3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.b1.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.b3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (Args.c1.emoji == x_emoji && Args.c2.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true;
|
|
||||||
if (won["<:X_:863314044781723668>"] != false)
|
|
||||||
if (Args.user == 0) {
|
|
||||||
const won = await client.users.fetch(fighters[1]).catch(console.error);
|
|
||||||
resolve(won);
|
|
||||||
|
|
||||||
if (options.resultBtn === true)
|
|
||||||
return m
|
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[1],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
components: buttons,
|
|
||||||
embeds: [
|
|
||||||
epm.setDescription(
|
|
||||||
interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[1],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
else if (!options.resultBtn || options.resultBtn === false)
|
|
||||||
return m
|
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[1],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
}),
|
|
||||||
embeds: [
|
|
||||||
epm.setDescription(
|
|
||||||
`${interaction.translate("fun/tictactoe:WON", {
|
|
||||||
winner: fighters[1],
|
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
|
||||||
})}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji
|
|
||||||
.replace(o_emoji, "⭕")
|
|
||||||
.replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
components: [],
|
|
||||||
});
|
|
||||||
} else if (Args.user == 1) {
|
|
||||||
const won = await client.users.fetch(fighters[0]).catch(console.error);
|
const won = await client.users.fetch(fighters[0]).catch(console.error);
|
||||||
resolve(won);
|
resolve(won);
|
||||||
|
|
||||||
if (options.resultBtn === true)
|
if (options.resultBtn === true) {
|
||||||
return m
|
return m.edit({
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[0],
|
winner: fighters[0],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
components: buttons,
|
components: buttons,
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
interaction.translate("fun/tictactoe:WON", {
|
interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[0],
|
winner: fighters[0],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
else
|
} else if (!options.resultBtn || options.resultBtn === false) {
|
||||||
return m
|
return m.edit({
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:WON", {
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[0],
|
winner: fighters[0],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
|
||||||
|
embeds: [
|
||||||
|
epm.setDescription(
|
||||||
|
`${interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[0],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
})}\n\`\`\`\n${Args.a1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n${Args.b1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n${Args.c1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
components: [],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Args.a1.emoji === xEmoji && Args.b1.emoji === xEmoji && Args.c1.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.a2.emoji === xEmoji && Args.b2.emoji === xEmoji && Args.c2.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.a3.emoji === xEmoji && Args.b3.emoji === xEmoji && Args.c3.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.a1.emoji === xEmoji && Args.b2.emoji === xEmoji && Args.c3.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.a3.emoji === xEmoji && Args.b2.emoji === xEmoji && Args.c1.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.a1.emoji === xEmoji && Args.a2.emoji === xEmoji && Args.a3.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.b1.emoji === xEmoji && Args.b2.emoji === xEmoji && Args.b3.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (Args.c1.emoji === xEmoji && Args.c2.emoji === xEmoji && Args.c3.emoji === xEmoji) won["<:X_:863314044781723668>"] = true;
|
||||||
|
if (won["<:X_:863314044781723668>"] !== false) {
|
||||||
|
if (Args.user === 0) {
|
||||||
|
const won = await client.users.fetch(fighters[1]).catch(console.error);
|
||||||
|
resolve(won);
|
||||||
|
|
||||||
|
if (options.resultBtn === true) {
|
||||||
|
return m.edit({
|
||||||
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[1],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
components: buttons,
|
||||||
|
embeds: [
|
||||||
|
epm.setDescription(
|
||||||
|
interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[1],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
} else if (!options.resultBtn || options.resultBtn === false) {
|
||||||
|
return m.edit({
|
||||||
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[1],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
embeds: [
|
||||||
|
epm.setDescription(
|
||||||
|
`${interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[1],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
})}\n\`\`\`\n${Args.a1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n${Args.b1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n${Args.c1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c3.emoji
|
||||||
|
.replace(oEmoji, "⭕")
|
||||||
|
.replace(xEmoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
components: [],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (Args.user === 1) {
|
||||||
|
const won = await client.users.fetch(fighters[0]).catch(console.error);
|
||||||
|
resolve(won);
|
||||||
|
|
||||||
|
if (options.resultBtn === true) {
|
||||||
|
return m.edit({
|
||||||
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[0],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
components: buttons,
|
||||||
|
embeds: [
|
||||||
|
epm.setDescription(
|
||||||
|
interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[0],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return m.edit({
|
||||||
|
content: interaction.translate("fun/tictactoe:WON", {
|
||||||
|
winner: fighters[0],
|
||||||
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
}),
|
}),
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
`${interaction.translate("fun/tictactoe:WON", {
|
`${interaction.translate("fun/tictactoe:WON", {
|
||||||
winner: fighters[0],
|
winner: fighters[0],
|
||||||
emoji: client.emojis.cache.get(o_emoji) || "⭕",
|
emoji: client.emojis.cache.get(oEmoji) || "⭕",
|
||||||
})}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji
|
})}\n\`\`\`\n${Args.a1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji
|
.replace(xEmoji, "❌")}\n${Args.b1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji
|
.replace(xEmoji, "❌")}\n${Args.c1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c2.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c3.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
.replace(xEmoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
components: [],
|
components: [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m.edit({
|
m.edit({
|
||||||
content: `<@${Args.userid}>`,
|
content: `<@${Args.userid}>`,
|
||||||
|
@ -437,7 +442,7 @@ async function tictactoe(interaction, options = {}) {
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
interaction.translate("fun/tictactoe:WAITING", {
|
interaction.translate("fun/tictactoe:WAITING", {
|
||||||
user: Args.userid,
|
user: Args.userid,
|
||||||
emoji: Args.user == 0 ? `${client.emojis.cache.get(o_emoji) || "⭕"}` : `${client.emojis.cache.get(x_emoji) || "❌"}`,
|
emoji: Args.user === 0 ? `${client.emojis.cache.get(oEmoji) || "⭕"}` : `${client.emojis.cache.get(xEmoji) || "❌"}`,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -458,18 +463,18 @@ async function tictactoe(interaction, options = {}) {
|
||||||
|
|
||||||
ttt(m);
|
ttt(m);
|
||||||
} else {
|
} else {
|
||||||
if (Args.user == 0) {
|
if (Args.user === 0) {
|
||||||
Args.user = 1;
|
Args.user = 1;
|
||||||
Args[b.customId] = {
|
Args[b.customId] = {
|
||||||
style: ButtonStyle.Success,
|
style: ButtonStyle.Success,
|
||||||
emoji: o_emoji,
|
emoji: oEmoji,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
Args.user = 0;
|
Args.user = 0;
|
||||||
Args[b.customId] = {
|
Args[b.customId] = {
|
||||||
style: ButtonStyle.Danger,
|
style: ButtonStyle.Danger,
|
||||||
emoji: x_emoji,
|
emoji: xEmoji,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -487,44 +492,43 @@ async function tictactoe(interaction, options = {}) {
|
||||||
.filter(key => predicate(obj[key]))
|
.filter(key => predicate(obj[key]))
|
||||||
.reduce((res, key) => ((res[key] = obj[key]), res), {});
|
.reduce((res, key) => ((res[key] = obj[key]), res), {});
|
||||||
const Brgs = objectFilter(
|
const Brgs = objectFilter(
|
||||||
map(Args, (_, fruit) => fruit.emoji == dashmoji),
|
map(Args, (_, fruit) => fruit.emoji === dashmoji),
|
||||||
num => num == true,
|
num => num === true,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Object.keys(Brgs).length == 0) {
|
if (Object.keys(Brgs).length === 0) {
|
||||||
if (Args.a1.emoji == o_emoji && Args.b1.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.b1.emoji === oEmoji && Args.c1.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.a2.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c2.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a2.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c2.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.a3.emoji == o_emoji && Args.b3.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a3.emoji === oEmoji && Args.b3.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.a1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.a3.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a3.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.c1.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.a1.emoji == o_emoji && Args.a2.emoji == o_emoji && Args.a3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.a1.emoji === oEmoji && Args.a2.emoji === oEmoji && Args.a3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.b1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.b3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.b1.emoji === oEmoji && Args.b2.emoji === oEmoji && Args.b3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
if (Args.c1.emoji == o_emoji && Args.c2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true;
|
if (Args.c1.emoji === oEmoji && Args.c2.emoji === oEmoji && Args.c3.emoji === oEmoji) won["<:O_:863314110560993340>"] = true;
|
||||||
|
|
||||||
if (won["<:O_:863314110560993340>"] == true) return ttt(m);
|
if (won["<:O_:863314110560993340>"] === true) return ttt(m);
|
||||||
else if (won["<:X_:863314044781723668>"] == true) return;
|
else if (won["<:X_:863314044781723668>"] === true) return;
|
||||||
else {
|
else {
|
||||||
ttt(m);
|
ttt(m);
|
||||||
|
|
||||||
if (options.resultBtn === true)
|
if (options.resultBtn === true) {
|
||||||
return m
|
return m.edit({
|
||||||
.edit({
|
|
||||||
content: interaction.translate("fun/tictactoe:TIE"),
|
content: interaction.translate("fun/tictactoe:TIE"),
|
||||||
embeds: [epm.setDescription(interaction.translate("fun/tictactoe:TIE_DESC"))],
|
embeds: [epm.setDescription(interaction.translate("fun/tictactoe:TIE_DESC"))],
|
||||||
});
|
});
|
||||||
else
|
} else {
|
||||||
return m
|
return m
|
||||||
.edit({
|
.edit({
|
||||||
content: interaction.translate("fun/tictactoe:TIE"),
|
content: interaction.translate("fun/tictactoe:TIE"),
|
||||||
embeds: [
|
embeds: [
|
||||||
epm.setDescription(
|
epm.setDescription(
|
||||||
`${interaction.translate("fun/tictactoe:TIE_DESC")}!\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji
|
`${interaction.translate("fun/tictactoe:TIE_DESC")}!\n\`\`\`\n${Args.a1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.a2.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")} | ${Args.a3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji
|
.replace(xEmoji, "❌")} | ${Args.a3.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")}\n${Args.b1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.b2.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")} | ${Args.b3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji
|
.replace(xEmoji, "❌")} | ${Args.b3.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")}\n${Args.c1.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")} | ${Args.c2.emoji
|
||||||
.replace(o_emoji, "⭕")
|
.replace(oEmoji, "⭕")
|
||||||
.replace(x_emoji, "❌")} | ${Args.c3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
.replace(xEmoji, "❌")} | ${Args.c3.emoji.replace(oEmoji, "⭕").replace(xEmoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
components: [],
|
components: [],
|
||||||
|
@ -532,25 +536,27 @@ async function tictactoe(interaction, options = {}) {
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ttt(m);
|
ttt(m);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
collector.on("end", (collected, reason) => {
|
collector.on("end", (collected, reason) => {
|
||||||
if (collected.size === 0 && reason == "time")
|
if (collected.size === 0 && reason === "time") {
|
||||||
m.edit({
|
m.edit({
|
||||||
content: interaction.translate("fun/tictactoe:NO_ANSWER", {
|
content: interaction.translate("fun/tictactoe:NO_ANSWER", {
|
||||||
user: Args.userid,
|
user: Args.userid,
|
||||||
}),
|
}),
|
||||||
components: [],
|
components: [],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("end", (_, reason) => {
|
collector.on("end", (_, reason) => {
|
||||||
if (reason == "time") {
|
if (reason === "time") {
|
||||||
const embed = client.embed({
|
const embed = client.embed({
|
||||||
author: {
|
author: {
|
||||||
name: user.getUsername(),
|
name: user.getUsername(),
|
||||||
|
@ -570,7 +576,7 @@ async function tictactoe(interaction, options = {}) {
|
||||||
components: [],
|
components: [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (reason == "decline") {
|
if (reason === "decline") {
|
||||||
const embed = client.embed({
|
const embed = client.embed({
|
||||||
author: {
|
author: {
|
||||||
name: user.getUsername(),
|
name: user.getUsername(),
|
||||||
|
@ -594,6 +600,4 @@ async function tictactoe(interaction, options = {}) {
|
||||||
console.log("TicTacToe errored:", e);
|
console.log("TicTacToe errored:", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = tictactoe;
|
|
||||||
|
|
7
index.js
7
index.js
|
@ -1,9 +1,10 @@
|
||||||
import "./helpers/extenders.js";
|
import "./helpers/extenders.js";
|
||||||
|
|
||||||
import { GatewayIntentBits } from "discord.js";
|
import { GatewayIntentBits } from "discord.js";
|
||||||
import Client from "./base/Client.js";
|
import JaBaClient from "./base/Client.js";
|
||||||
|
import languages from "./helpers/languages.js";
|
||||||
|
|
||||||
const client = new Client({
|
const client = new JaBaClient({
|
||||||
intents: [
|
intents: [
|
||||||
GatewayIntentBits.Guilds,
|
GatewayIntentBits.Guilds,
|
||||||
GatewayIntentBits.GuildMembers,
|
GatewayIntentBits.GuildMembers,
|
||||||
|
@ -27,7 +28,7 @@ const client = new Client({
|
||||||
(async () => {
|
(async () => {
|
||||||
console.time("botReady");
|
console.time("botReady");
|
||||||
|
|
||||||
client.translations = await require("./helpers/languages")();
|
client.translations = await languages();
|
||||||
|
|
||||||
await client.loadEvents("../events");
|
await client.loadEvents("../events");
|
||||||
await client.loadCommands("../commands");
|
await client.loadCommands("../commands");
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
"AUTO_SANCTIONS": "Automatic Sanctions",
|
"AUTO_SANCTIONS": "Automatic Sanctions",
|
||||||
"BAN_CONTENT": "Ban: After **{{count}}** warnings",
|
"BAN_CONTENT": "Ban: After **{{count}}** warnings",
|
||||||
"BAN_NOT_DEFINED": "Ban: Not set",
|
"BAN_NOT_DEFINED": "Ban: Not set",
|
||||||
"DASHBOARD_TITLE": "Modify Settings",
|
|
||||||
"DASHBOARD_CONTENT": "Click here to go to the dashboard",
|
|
||||||
"GOODBYE_TITLE": "Farewell",
|
"GOODBYE_TITLE": "Farewell",
|
||||||
"GOODBYE_CONTENT": "Channel: {{channel}}\nCard: {{withImage}}",
|
"GOODBYE_CONTENT": "Channel: {{channel}}\nCard: {{withImage}}",
|
||||||
"KICK_CONTENT": "Kick: After **{{count}}** warnings",
|
"KICK_CONTENT": "Kick: After **{{count}}** warnings",
|
||||||
|
|
|
@ -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 <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
|
|
||||||
"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!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@
|
||||||
"OPTION_NAN_ALL": "Please specify an integer greater than 0 or `all`.",
|
"OPTION_NAN_ALL": "Please specify an integer greater than 0 or `all`.",
|
||||||
"OWNER_ONLY": "Only the bot owner can use this command.",
|
"OWNER_ONLY": "Only the bot owner can use this command.",
|
||||||
"SELECT_CANCELED": "Selection canceled.",
|
"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.",
|
"TIMED_OUT": "Time out.",
|
||||||
"JUMP_TO_PAGE": "Specify the page you want to jump to (maximum **{{length}}**):",
|
"JUMP_TO_PAGE": "Specify the page you want to jump to (maximum **{{length}}**):",
|
||||||
"QUOTE_TITLE": "Message from {{user}}",
|
"QUOTE_TITLE": "Message from {{user}}",
|
||||||
|
|
23
languages/language-meta.js
Normal file
23
languages/language-meta.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
name: "en-US",
|
||||||
|
nativeName: "English",
|
||||||
|
moment: "en",
|
||||||
|
defaultMomentFormat: "HH:mm:ss, MMMM Do YYYY",
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ru-RU",
|
||||||
|
nativeName: "Русский",
|
||||||
|
moment: "ru",
|
||||||
|
defaultMomentFormat: "HH:mm:ss, Do MMMM YYYY",
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "uk-UA",
|
||||||
|
nativeName: "Українська",
|
||||||
|
moment: "uk",
|
||||||
|
defaultMomentFormat: "HH:mm:ss, Do MMMM YYYY",
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
];
|
|
@ -1,23 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "en-US",
|
|
||||||
"nativeName": "English",
|
|
||||||
"moment": "en",
|
|
||||||
"defaultMomentFormat": "HH:mm:ss, MMMM Do YYYY",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ru-RU",
|
|
||||||
"nativeName": "Русский",
|
|
||||||
"moment": "ru",
|
|
||||||
"defaultMomentFormat": "HH:mm:ss, Do MMMM YYYY",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "uk-UA",
|
|
||||||
"nativeName": "Українська",
|
|
||||||
"moment": "uk",
|
|
||||||
"defaultMomentFormat": "HH:mm:ss, Do MMMM YYYY",
|
|
||||||
"default": false
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -23,8 +23,6 @@
|
||||||
"AUTO_SANCTIONS": "Автоматические наказания",
|
"AUTO_SANCTIONS": "Автоматические наказания",
|
||||||
"BAN_CONTENT": "Бан: После **{{count}}** предупреждений",
|
"BAN_CONTENT": "Бан: После **{{count}}** предупреждений",
|
||||||
"BAN_NOT_DEFINED": "Бан: Не назначено",
|
"BAN_NOT_DEFINED": "Бан: Не назначено",
|
||||||
"DASHBOARD_TITLE": "Изменить настройки",
|
|
||||||
"DASHBOARD_CONTENT": "Нажмите сюда, чтобы перейти в панель управления",
|
|
||||||
"GOODBYE_TITLE": "Прощание",
|
"GOODBYE_TITLE": "Прощание",
|
||||||
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
|
||||||
"KICK_CONTENT": "Кик: После **{{count}}** предупреждений",
|
"KICK_CONTENT": "Кик: После **{{count}}** предупреждений",
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Русский",
|
|
||||||
"index": {
|
|
||||||
"feeds": [ "Текущий пользователь", "Играю музыку в стольких серверах", "Кол-во пользователей", "Кол-во серверов" ],
|
|
||||||
"card": {
|
|
||||||
"category": "JaBa Bot",
|
|
||||||
"title": "Простой бот, созданный <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
|
|
||||||
"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": "Выберите предпочитаемый язык!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@
|
||||||
"OPTION_NAN_ALL": "Укажите целое число больше 0 или `all`",
|
"OPTION_NAN_ALL": "Укажите целое число больше 0 или `all`",
|
||||||
"OWNER_ONLY": "Данную команду может использовать только владелец бота",
|
"OWNER_ONLY": "Данную команду может использовать только владелец бота",
|
||||||
"SELECT_CANCELED": "Выбор отменён",
|
"SELECT_CANCELED": "Выбор отменён",
|
||||||
"STATS_FOOTER": "● [Панель управления]({{dashboardLink}})\n● [Сервер поддержки]({{supportLink}})\n● [Пригласить JaBa на свой сервер]({{inviteLink}})",
|
"STATS_FOOTER": "● [Сервер поддержки]({{supportLink}})\n● [Пригласить JaBa на свой сервер]({{inviteLink}})",
|
||||||
"TIMED_OUT": "Время вышло",
|
"TIMED_OUT": "Время вышло",
|
||||||
"JUMP_TO_PAGE": "Укажите страницу к которой хотите перейти (максимум **{{length}}**):",
|
"JUMP_TO_PAGE": "Укажите страницу к которой хотите перейти (максимум **{{length}}**):",
|
||||||
"QUOTE_TITLE": "Сообщение от {{user}}",
|
"QUOTE_TITLE": "Сообщение от {{user}}",
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
"AUTO_SANCTIONS": "Автоматичні покарання",
|
"AUTO_SANCTIONS": "Автоматичні покарання",
|
||||||
"BAN_CONTENT": "Бан: Після **{{count}}** попереджень",
|
"BAN_CONTENT": "Бан: Після **{{count}}** попереджень",
|
||||||
"BAN_NOT_DEFINED": "Бан: Не призначено",
|
"BAN_NOT_DEFINED": "Бан: Не призначено",
|
||||||
"DASHBOARD_TITLE": "Змінити налаштування",
|
|
||||||
"DASHBOARD_CONTENT": "Натисніть сюди, щоб перейти до панелі керування",
|
|
||||||
"GOODBYE_TITLE": "Прощання",
|
"GOODBYE_TITLE": "Прощання",
|
||||||
"GOODBYE_CONTENT": "Канал: {{channel}}\nКартка: {{withImage}}",
|
"GOODBYE_CONTENT": "Канал: {{channel}}\nКартка: {{withImage}}",
|
||||||
"KICK_CONTENT": "Кік: Після **{{count}}** попереджень",
|
"KICK_CONTENT": "Кік: Після **{{count}}** попереджень",
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Українська",
|
|
||||||
"index": {
|
|
||||||
"feeds": [ "Поточний Користувач", "Играю музыку в стольких серверах", "Кількість користувачів", "Кількість серверів" ],
|
|
||||||
"card": {
|
|
||||||
"category": "JaBa Бот",
|
|
||||||
"title": "Простий бот, створений <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
|
|
||||||
"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": "Виберіть бажану мову!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@
|
||||||
"OPTION_NAN_ALL": "Вкажіть ціле число більше 0 або `all`",
|
"OPTION_NAN_ALL": "Вкажіть ціле число більше 0 або `all`",
|
||||||
"OWNER_ONLY": "Цю команду може використовувати тільки власник бота",
|
"OWNER_ONLY": "Цю команду може використовувати тільки власник бота",
|
||||||
"SELECT_CANCELED": "Вибір скасовано",
|
"SELECT_CANCELED": "Вибір скасовано",
|
||||||
"STATS_FOOTER": "● [Панель керування]({{dashboardLink}})\n● [Сервер підтримки]({{supportLink}})\n● [Запросити JaBa на свій сервер]({{inviteLink}})",
|
"STATS_FOOTER": "● [Сервер підтримки]({{supportLink}})\n● [Запросити JaBa на свій сервер]({{inviteLink}})",
|
||||||
"TIMED_OUT": "Час вийшов",
|
"TIMED_OUT": "Час вийшов",
|
||||||
"JUMP_TO_PAGE": "Вкажіть сторінку, до якої хочете перейти (максимум **{{length}}**):",
|
"JUMP_TO_PAGE": "Вкажіть сторінку, до якої хочете перейти (максимум **{{length}}**):",
|
||||||
"QUOTE_TITLE": "Повідомлення від {{user}}",
|
"QUOTE_TITLE": "Повідомлення від {{user}}",
|
||||||
|
|
Loading…
Reference in a new issue