mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-04 09:43:03 +05:00
Compare commits
No commits in common. "e65d9adbe1086b8112f5d0db870711d0dad97221" and "784f3e966ab961a17757caf7d1bf62a9c442632f" have entirely different histories.
e65d9adbe1
...
784f3e966a
15 changed files with 11 additions and 298 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,4 +1,4 @@
|
||||||
[submodule "dashboard/dashboard-core"]
|
[submodule "dashboard/dashboard-core"]
|
||||||
path = dashboard/dashboard-core
|
path = dashboard/dashboard-core
|
||||||
url = https://git.jonnybro.ru/jonny_bro/dashboard-core
|
url = http://192.168.1.200:3000/jonny_bro/dashboard-core
|
||||||
branch = main
|
branch = main
|
||||||
|
|
|
@ -12,10 +12,7 @@ class ImportMee6 extends BaseCommand {
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
.setName("importmee6")
|
.setName("importmee6")
|
||||||
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
|
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
|
||||||
.setDescriptionLocalizations({
|
.setDescriptionLocalizations({ uk: client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/importmee6:DESCRIPTION", null, "ru-RU") })
|
||||||
uk: client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA"),
|
|
||||||
ru: client.translate("economy/importmee6:DESCRIPTION", null, "ru-RU"),
|
|
||||||
})
|
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
dirname: __dirname,
|
dirname: __dirname,
|
||||||
ownerOnly: false,
|
ownerOnly: false,
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Addemoji extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/Client")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("addemoji")
|
|
||||||
.setDescription(client.translate("administration/addemoji:DESCRIPTION"))
|
|
||||||
.setDescriptionLocalizations({
|
|
||||||
uk: client.translate("administration/addemoji:DESCRIPTION", null, "uk-UA"),
|
|
||||||
ru: client.translate("administration/addemoji:DESCRIPTION", null, "ru-RU"),
|
|
||||||
})
|
|
||||||
.setDMPermission(false)
|
|
||||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("link")
|
|
||||||
.setDescription(client.translate("common:LINK"))
|
|
||||||
.setDescriptionLocalizations({
|
|
||||||
uk: client.translate("common:LINK", null, "uk-UA"),
|
|
||||||
ru: client.translate("common:LINK", null, "ru-RU"),
|
|
||||||
})
|
|
||||||
.setRequired(true),
|
|
||||||
)
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("name")
|
|
||||||
.setDescription(client.translate("common:NAME"))
|
|
||||||
.setDescriptionLocalizations({
|
|
||||||
uk: client.translate("common:NAME", null, "uk-UA"),
|
|
||||||
ru: client.translate("common:NAME", null, "ru-RU"),
|
|
||||||
})
|
|
||||||
.setRequired(true),
|
|
||||||
),
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/Client")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
*/
|
|
||||||
async execute(client, interaction) {
|
|
||||||
const link = interaction.options.getString("link"),
|
|
||||||
name = interaction.options.getString("name");
|
|
||||||
|
|
||||||
interaction.guild.emojis
|
|
||||||
.create({
|
|
||||||
name: name,
|
|
||||||
attachment: link,
|
|
||||||
})
|
|
||||||
.then(emoji =>
|
|
||||||
interaction.success("administration/stealemoji:SUCCESS", {
|
|
||||||
emoji: emoji.name,
|
|
||||||
}, { ephemeral: true }),
|
|
||||||
)
|
|
||||||
.catch(e => {
|
|
||||||
interaction.error("administration/stealemoji:ERROR", {
|
|
||||||
emoji: name,
|
|
||||||
e,
|
|
||||||
}, { ephemeral: true });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Addemoji;
|
|
|
@ -34,7 +34,7 @@ class Boosters extends BaseCommand {
|
||||||
interaction.data.guild = await client.findOrCreateGuild(interaction.guildId);
|
interaction.data.guild = await client.findOrCreateGuild(interaction.guildId);
|
||||||
|
|
||||||
const boosters = (await interaction.guild.members.fetch()).filter(m => m.premiumSince),
|
const boosters = (await interaction.guild.members.fetch()).filter(m => m.premiumSince),
|
||||||
embeds = generateBoostersEmbeds(interaction, boosters);
|
embeds = generateBoostersEmbeds(client, interaction, boosters);
|
||||||
|
|
||||||
const row = new ActionRowBuilder().addComponents(
|
const row = new ActionRowBuilder().addComponents(
|
||||||
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||||
|
@ -143,11 +143,12 @@ class Boosters extends BaseCommand {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
* @param {import("../../base/Client")} client
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
||||||
* @param {Array} boosters
|
* @param {Array} boosters
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function generateBoostersEmbeds(interaction, boosters) {
|
function generateBoostersEmbeds(client, interaction, boosters) {
|
||||||
const embeds = [];
|
const embeds = [];
|
||||||
let k = 10;
|
let k = 10;
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ function generateBoostersEmbeds(interaction, boosters) {
|
||||||
|
|
||||||
const info = current.map(member => `${++j}. ${member.toString()} | ${interaction.translate("general/boosters:BOOSTER_SINCE")}: **${Math.floor(new Date(member.premiumSince).getTime() / 1000)}**`).join("\n");
|
const info = current.map(member => `${++j}. ${member.toString()} | ${interaction.translate("general/boosters:BOOSTER_SINCE")}: **${Math.floor(new Date(member.premiumSince).getTime() / 1000)}**`).join("\n");
|
||||||
|
|
||||||
const embed = interaction.client.embed({
|
const embed = client.embed({
|
||||||
title: interaction.translate("general/boosters:BOOSTERS_LIST"),
|
title: interaction.translate("general/boosters:BOOSTERS_LIST"),
|
||||||
description: info,
|
description: info,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,176 +0,0 @@
|
||||||
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
|
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
|
||||||
|
|
||||||
class Reminds extends BaseCommand {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../base/Client")} client
|
|
||||||
*/
|
|
||||||
constructor(client) {
|
|
||||||
super({
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName("reminds")
|
|
||||||
.setDescription(client.translate("general/reminds:DESCRIPTION"))
|
|
||||||
.setDescriptionLocalizations({
|
|
||||||
uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"),
|
|
||||||
ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"),
|
|
||||||
})
|
|
||||||
.setDMPermission(false),
|
|
||||||
dirname: __dirname,
|
|
||||||
ownerOnly: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/Client")} client
|
|
||||||
*/
|
|
||||||
async onLoad(client) {
|
|
||||||
client.on("interactionCreate", async interaction => {
|
|
||||||
if (!interaction.isButton()) return;
|
|
||||||
|
|
||||||
if (interaction.customId.startsWith("reminds_")) {
|
|
||||||
interaction.data = [];
|
|
||||||
interaction.data.guild = await client.findOrCreateGuild(interaction.guildId);
|
|
||||||
interaction.data.user = await client.findOrCreateUser(interaction.user.id);
|
|
||||||
|
|
||||||
const reminds = interaction.data.user.reminds,
|
|
||||||
embeds = generateRemindsEmbeds(interaction, reminds);
|
|
||||||
|
|
||||||
const row = new ActionRowBuilder().addComponents(
|
|
||||||
new ButtonBuilder().setCustomId("reminds_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_jump_page").setStyle(ButtonStyle.Secondary).setEmoji("↗️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_stop").setStyle(ButtonStyle.Danger).setEmoji("❌"),
|
|
||||||
);
|
|
||||||
|
|
||||||
let currentPage = Number(interaction.message.content.match(/\d+/g)[0]) - 1 ?? 0;
|
|
||||||
|
|
||||||
if (interaction.customId === "reminds_prev_page") {
|
|
||||||
await interaction.deferUpdate();
|
|
||||||
|
|
||||||
if (currentPage !== 0) {
|
|
||||||
--currentPage;
|
|
||||||
interaction.editReply({
|
|
||||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
|
||||||
embeds: [embeds[currentPage]],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (interaction.customId === "reminds_next_page") {
|
|
||||||
await interaction.deferUpdate();
|
|
||||||
|
|
||||||
if (currentPage < embeds.length - 1) {
|
|
||||||
currentPage++;
|
|
||||||
interaction.editReply({
|
|
||||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
|
||||||
embeds: [embeds[currentPage]],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (interaction.customId === "reminds_jump_page") {
|
|
||||||
await interaction.deferUpdate();
|
|
||||||
|
|
||||||
const msg = await interaction.followUp({
|
|
||||||
content: interaction.translate("misc:JUMP_TO_PAGE", {
|
|
||||||
length: embeds.length,
|
|
||||||
}),
|
|
||||||
fetchReply: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const filter = res => {
|
|
||||||
return res.author.id === interaction.user.id && !isNaN(res.content);
|
|
||||||
};
|
|
||||||
|
|
||||||
interaction.channel.awaitMessages({ filter, max: 1, time: 10 * 1000 }).then(collected => {
|
|
||||||
if (embeds[collected.first().content - 1]) {
|
|
||||||
currentPage = collected.first().content - 1;
|
|
||||||
interaction.editReply({
|
|
||||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
|
||||||
embeds: [embeds[currentPage]],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
|
|
||||||
if (collected.first().deletable) collected.first().delete();
|
|
||||||
if (msg.deletable) msg.delete();
|
|
||||||
} else {
|
|
||||||
if (collected.first().deletable) collected.first().delete();
|
|
||||||
if (msg.deletable) msg.delete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (interaction.customId === "reminds_stop") {
|
|
||||||
await interaction.deferUpdate();
|
|
||||||
|
|
||||||
row.components.forEach(component => {
|
|
||||||
component.setDisabled(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
return interaction.editReply({
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../base/Client")} client
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
*/
|
|
||||||
async execute(client, interaction) {
|
|
||||||
await interaction.deferReply();
|
|
||||||
|
|
||||||
const reminds = interaction.data.user.reminds;
|
|
||||||
if (reminds.length === 0) return interaction.error("general/reminds:NO_REMINDS", null, { edit: true });
|
|
||||||
|
|
||||||
const embeds = generateRemindsEmbeds(interaction, reminds);
|
|
||||||
|
|
||||||
const row = new ActionRowBuilder().addComponents(
|
|
||||||
new ButtonBuilder().setCustomId("reminds_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_jump_page").setStyle(ButtonStyle.Secondary).setEmoji("↗️"),
|
|
||||||
new ButtonBuilder().setCustomId("reminds_stop").setStyle(ButtonStyle.Danger).setEmoji("❌"),
|
|
||||||
);
|
|
||||||
|
|
||||||
await interaction.editReply({
|
|
||||||
content: `${interaction.translate("common:PAGE")}: **1**/**${embeds.length}**`,
|
|
||||||
embeds: [embeds[0]],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
||||||
* @param {Array} reminds
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
function generateRemindsEmbeds(interaction, reminds) {
|
|
||||||
const embeds = [];
|
|
||||||
let k = 5;
|
|
||||||
|
|
||||||
for (let i = 0; i < reminds.length; i += 5) {
|
|
||||||
const current = reminds
|
|
||||||
.sort((a, b) => a.createdAt - b.createdAt)
|
|
||||||
.map(g => g)
|
|
||||||
.slice(i, k);
|
|
||||||
let j = i;
|
|
||||||
k += 5;
|
|
||||||
|
|
||||||
const info = current.map(r => `${++j}. ${interaction.client.translate("general/remindme:EMBED_CREATED")}: <t:${r.createdAt}:f>\n${interaction.client.translate("general/remindme:EMBED_TIME")}: <t:${r.sendAt}:f>\n${interaction.client.translate("common:MESSAGE")}: \`${r.message}\``).join("\n");
|
|
||||||
|
|
||||||
const embed = interaction.client.embed({
|
|
||||||
title: interaction.translate("general/reminds:REMINDS_LIST"),
|
|
||||||
description: info,
|
|
||||||
});
|
|
||||||
|
|
||||||
embeds.push(embed);
|
|
||||||
}
|
|
||||||
|
|
||||||
return embeds;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Reminds;
|
|
|
@ -34,7 +34,7 @@ class CreateTicketEmbed extends BaseCommand {
|
||||||
interaction.data = [];
|
interaction.data = [];
|
||||||
interaction.data.guild = await client.findOrCreateGuild(interaction.guildId);
|
interaction.data.guild = await client.findOrCreateGuild(interaction.guildId);
|
||||||
|
|
||||||
const guildData = interaction.data.guild,
|
const guildData = interaction.guild.data,
|
||||||
ticketsCategory = guildData.plugins?.tickets?.ticketsCategory,
|
ticketsCategory = guildData.plugins?.tickets?.ticketsCategory,
|
||||||
ticketLogs = guildData.plugins?.tickets?.ticketLogs,
|
ticketLogs = guildData.plugins?.tickets?.ticketLogs,
|
||||||
transcriptionLogs = guildData.plugins?.tickets?.transcriptionLogs;
|
transcriptionLogs = guildData.plugins?.tickets?.transcriptionLogs;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d63e6e4301abfdba6ba031adfd6115c4a639cb88
|
Subproject commit 565174444577d51cc6bf86d0478a01aad7be0248
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Adds an emoji to the current server from given link",
|
|
||||||
"USAGE": "[link] [name]",
|
|
||||||
"EXAMPLES": "addemoji link:https://google.com name:google"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Lists your reminds",
|
|
||||||
"USAGE": "",
|
|
||||||
"EXAMPLES": "reminds",
|
|
||||||
"NO_REMINDS": "No reminds found",
|
|
||||||
"REMINDS_LIST": "Reminds List"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Добавляет эмодзи на сервер по ссылке",
|
|
||||||
"USAGE": "[link] [name]",
|
|
||||||
"EXAMPLES": "addemoji link:https://google.com name:google"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Список ваших напоминаний",
|
|
||||||
"USAGE": "",
|
|
||||||
"EXAMPLES": "reminds",
|
|
||||||
"NO_REMINDS": "Напоминания отсутствуют",
|
|
||||||
"REMINDS_LIST": "Список Напоминаний"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Додає емодзі на сервер за посиланням",
|
|
||||||
"USAGE": "[link] [name]",
|
|
||||||
"EXAMPLES": "addemoji link:https://google.com name:google"
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
"DESCRIPTION": "Список учасників, які дали буст серверу",
|
"DESCRIPTION": "Список учасників, які дали буст серверу",
|
||||||
"USAGE": "",
|
"USAGE": "",
|
||||||
"EXAMPLES": "boosters",
|
"EXAMPLES": "boosters",
|
||||||
"BOOSTERS_LIST": "Список Бустерів",
|
"BOOSTERS_LIST": "Список бустерів",
|
||||||
"NO_BOOSTERS": "Бусти відсутні",
|
"NO_BOOSTERS": "Бусти відсутні",
|
||||||
"BOOSTER_SINCE": "Буст з"
|
"BOOSTER_SINCE": "Буст з"
|
||||||
}
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"DESCRIPTION": "Список ваших нагадувань",
|
|
||||||
"USAGE": "",
|
|
||||||
"EXAMPLES": "reminds",
|
|
||||||
"NO_REMINDS": "Нагадування відсутні",
|
|
||||||
"REMINDS_LIST": "Список Нагадування"
|
|
||||||
}
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "jaba",
|
"name": "jaba",
|
||||||
"version": "4.4.4",
|
"version": "4.4.3",
|
||||||
"description": "My Discord Bot",
|
"description": "My Discord Bot",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
"start": "node .",
|
"start": "node .",
|
||||||
"lint": "eslint . --ext .js --ignore-pattern \"dashboard-core/\""
|
"lint": "eslint . --ext .js"
|
||||||
},
|
},
|
||||||
"author": "Discord: @jonny_bro",
|
"author": "Discord: @jonny_bro",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in a new issue