From 7762cd124f39c3cdc748a8a230e5dd7feb8bec30 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Fri, 1 Apr 2022 16:54:48 +0500 Subject: [PATCH] v3.4.6 --- commands/General/github.js | 52 ------------------ commands/General/hastebin.js | 54 ------------------- .../General/{invitations.js => invites.js} | 20 +++---- commands/General/someone.js | 39 -------------- dashboard/public/docs/updates.md | 7 +++ events/messageCreate.js | 2 - languages/ru-RU/general/github.json | 8 --- languages/ru-RU/general/hastebin.json | 7 --- .../{invitations.json => invites.json} | 4 +- languages/ru-RU/general/someone.json | 5 -- languages/uk-UA/general/github.json | 8 --- languages/uk-UA/general/hastebin.json | 7 --- .../{invitations.json => invites.json} | 4 +- languages/uk-UA/general/someone.json | 5 -- package-lock.json | 4 +- package.json | 2 +- 16 files changed, 24 insertions(+), 204 deletions(-) delete mode 100644 commands/General/github.js delete mode 100644 commands/General/hastebin.js rename commands/General/{invitations.js => invites.js} (69%) delete mode 100644 commands/General/someone.js delete mode 100644 languages/ru-RU/general/github.json delete mode 100644 languages/ru-RU/general/hastebin.json rename languages/ru-RU/general/{invitations.json => invites.json} (83%) delete mode 100644 languages/ru-RU/general/someone.json delete mode 100644 languages/uk-UA/general/github.json delete mode 100644 languages/uk-UA/general/hastebin.json rename languages/uk-UA/general/{invitations.json => invites.json} (83%) delete mode 100644 languages/uk-UA/general/someone.json diff --git a/commands/General/github.js b/commands/General/github.js deleted file mode 100644 index 3512e9e0..00000000 --- a/commands/General/github.js +++ /dev/null @@ -1,52 +0,0 @@ -const Command = require("../../base/Command"), - Discord = require("discord.js"), - fetch = require("node-fetch"); - -class Github extends Command { - constructor(client) { - super(client, { - name: "github", - dirname: __dirname, - enabled: false, - guildOnly: false, - aliases: ["git"], - memberPermissions: [], - botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], - nsfw: false, - ownerOnly: false, - cooldown: 1000 - }); - } - - async run(message, args, data) { - const res = await fetch("https://api.github.com/repos/JonnyBro/JaBa"); - const json = await res.json(); - - const embed = new Discord.MessageEmbed() - .setAuthor({ - name: this.client.user.tag, - iconURL: this.client.user.displayAvatarURL({ - size: 512, - dynamic: true, - format: "png" - }) - }) - .setDescription(`[${message.translate("general/github:CLICK_HERE")}](${json.html_url})`) - .addField("Название", json.name, true) - .addField("Звёзды", json.stargazers_count, true) - .addField("Форки", json.forks_count, true) - .addField(message.translate("general/github:LANGUAGE"), json.language, true) - .addField(message.translate("general/github:OWNER"), `[${json.owner.login}](${json.owner.html_url})`) - .setImage(json.owner.avatar_url) - .setColor(data.config.embed.color) - .setFooter({ - text: data.config.embed.footer - }); - - message.reply({ - embeds: [embed] - }); - } -} - -module.exports = Github; \ No newline at end of file diff --git a/commands/General/hastebin.js b/commands/General/hastebin.js deleted file mode 100644 index 53f3896f..00000000 --- a/commands/General/hastebin.js +++ /dev/null @@ -1,54 +0,0 @@ -const Command = require("../../base/Command"), - Discord = require("discord.js"), - fetch = require("node-fetch"); - -class Hastebin extends Command { - constructor(client) { - super(client, { - name: "hastebin", - dirname: __dirname, - enabled: true, - guildOnly: false, - aliases: ["hb"], - memberPermissions: [], - botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], - nsfw: false, - ownerOnly: false, - cooldown: 1000 - }); - } - - async run(message, args, data) { - const content = args.join(" "); - if (!content) return message.error("general/hastebin:MISSING_TEXT"); - - try { - const res = await fetch("https://hastebin.com/documents", { - method: "POST", - body: content, - headers: { - "Content-Type": "text/plain" - } - }); - - const json = await res.json(); - if (!json.key) return message.error("misc:ERR_OCCURRED"); - - const url = `https://hastebin.com/${json.key}.js`; - - const embed = new Discord.MessageEmbed() - .setAuthor({ - name: message.translate("general/hastebin:SUCCESS") - }) - .setDescription(url) - .setColor(data.config.embed.color); - message.reply({ - embeds: [embed] - }); - } catch (e) { - message.error("misc:ERR_OCCURRED"); - } - } -} - -module.exports = Hastebin; \ No newline at end of file diff --git a/commands/General/invitations.js b/commands/General/invites.js similarity index 69% rename from commands/General/invitations.js rename to commands/General/invites.js index 1b7ea1e9..64621010 100644 --- a/commands/General/invitations.js +++ b/commands/General/invites.js @@ -1,10 +1,10 @@ const Command = require("../../base/Command"), Discord = require("discord.js"); -class Invitations extends Command { +class Invites extends Command { constructor(client) { super(client, { - name: "invitations", + name: "invites", dirname: __dirname, enabled: true, guildOnly: true, @@ -28,16 +28,16 @@ class Invitations extends Command { if (memberInvites.size <= 0) { if (member === message.member) { - return message.error("general/invitations:NOBODY_AUTHOR"); + return message.error("general/invites:NOBODY_AUTHOR"); } else { - return message.error("general/invitations:NOBODY_MEMBER", { + return message.error("general/invites:NOBODY_MEMBER", { member: member.user.tag }); } } const content = memberInvites.map((i) => { - return message.translate("general/invitations:CODE", { + return message.translate("general/invites:CODE", { uses: i.uses, code: i.code, channel: i.channel.toString() @@ -52,16 +52,16 @@ class Invitations extends Command { text: data.config.embed.footer }) .setAuthor({ - name: message.translate("general/invitations:TRACKER") + name: message.translate("general/invites:TRACKER") }) - .setDescription(message.translate("general/invitations:TITLE", { + .setDescription(message.translate("general/invites:TITLE", { member: member.user.tag, guild: message.guild.name })) - .addField(message.translate("general/invitations:FIELD_INVITED"), message.translate("general/invitations:FIELD_MEMBERS", { + .addField(message.translate("general/invites:FIELD_INVITED"), message.translate("general/invites:FIELD_MEMBERS", { total: index })) - .addField(message.translate("general/invitations:FIELD_CODES"), content); + .addField(message.translate("general/invites:FIELD_CODES"), content); message.reply({ embeds: [embed] @@ -69,4 +69,4 @@ class Invitations extends Command { } } -module.exports = Invitations; \ No newline at end of file +module.exports = Invites; \ No newline at end of file diff --git a/commands/General/someone.js b/commands/General/someone.js deleted file mode 100644 index c07b15a8..00000000 --- a/commands/General/someone.js +++ /dev/null @@ -1,39 +0,0 @@ -const Command = require("../../base/Command"), - Discord = require("discord.js"); - -class Someone extends Command { - constructor(client) { - super(client, { - name: "someone", - dirname: __dirname, - enabled: false, - guildOnly: true, - aliases: ["somebody"], - memberPermissions: [], - botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], - nsfw: false, - ownerOnly: false, - cooldown: 1000 - }); - } - - async run(message, args, data) { - const member = message.guild.members.cache.random(1)[0]; - - const embed = new Discord.MessageEmbed() - .addField(message.translate("common:USERNAME"), member.user.username, true) - .addField(message.translate("common:DISCRIMINATOR"), member.user.discriminator, true) - .addField(message.translate("common:ID"), member.user.id, true) - .setThumbnail(member.user.displayAvatarURL({ - size: 512, - dynamic: true, - format: "png" - })) - .setColor(data.config.embed.color); - message.reply({ - embeds: [embed] - }); - } -} - -module.exports = Someone; \ No newline at end of file diff --git a/dashboard/public/docs/updates.md b/dashboard/public/docs/updates.md index 8aa24d85..40cb76b7 100644 --- a/dashboard/public/docs/updates.md +++ b/dashboard/public/docs/updates.md @@ -1,3 +1,10 @@ +### JaBa v3.4.6 +* Изменено + * Команда *invitations* переименована в *invites*. + +* Удалено + * Команды *github*, *hastebin*, *someone*. + ### JaBa v3.4.5 * Добавлено * Команда *memes* - Получить мем с выбранного или случайного сабреддита. diff --git a/events/messageCreate.js b/events/messageCreate.js index d917fa78..aeb5257b 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -31,8 +31,6 @@ module.exports = class { else return message.sendT("misc:HELLO_DM"); } - if (message.content.includes("@someone") && message.guild && client.commands.get("someone").conf.enabled) return client.commands.get("someone").run(message, null, data); - if (message.guild) { const memberData = await client.findOrCreateMember({ id: message.author.id, diff --git a/languages/ru-RU/general/github.json b/languages/ru-RU/general/github.json deleted file mode 100644 index 22339375..00000000 --- a/languages/ru-RU/general/github.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "DESCRIPTION": "Показать информацию о GitHub репозитории старой версии JaBa!", - "USAGE": "{{prefix}}github", - "EXAMPLES": "{{prefix}}github", - "CLICK_HERE": "Нажмите сюда, чтобы открыть ссылку", - "LANGUAGE": "Язык", - "OWNER": "Владелец репозитория" -} \ No newline at end of file diff --git a/languages/ru-RU/general/hastebin.json b/languages/ru-RU/general/hastebin.json deleted file mode 100644 index 49c567e6..00000000 --- a/languages/ru-RU/general/hastebin.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "DESCRIPTION": "Опубликовать ваш текст на Hastebin!", - "USAGE": "{{prefix}}hastebin [текст]", - "EXAMPLES": "{{prefix}}hastebin Hello World!", - "MISSING_TEXT": "Введите текст!", - "SUCCESS": "Успешно опубликовано!" -} \ No newline at end of file diff --git a/languages/ru-RU/general/invitations.json b/languages/ru-RU/general/invites.json similarity index 83% rename from languages/ru-RU/general/invitations.json rename to languages/ru-RU/general/invites.json index 4d7ca50c..bdfd8ff7 100644 --- a/languages/ru-RU/general/invitations.json +++ b/languages/ru-RU/general/invites.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Показать кол-во пользователей которых пользователь пригласил на сервер!", - "USAGE": "{{prefix}}invitations (@пользователь)", - "EXAMPLES": "{{prefix}}invitations\n{{prefix}}invitations @Jonny_Bro#4226", + "USAGE": "{{prefix}}invites (@пользователь)", + "EXAMPLES": "{{prefix}}invites\n{{prefix}}invites @Jonny_Bro#4226", "NOBODY_AUTHOR": "Вы никого не пригласили на сервер!", "NOBODY_MEMBER": "{{member}} никого не приглашал(а) на сервер!", "CODE": "**{{code}}** ({{uses}} использований) | {{channel}}", diff --git a/languages/ru-RU/general/someone.json b/languages/ru-RU/general/someone.json deleted file mode 100644 index 47302b3d..00000000 --- a/languages/ru-RU/general/someone.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "DESCRIPTION": "Выбрать случайного участника на сервере!", - "USAGE": "{{prefix}}someone", - "EXAMPLES": "{{prefix}}someone" -} \ No newline at end of file diff --git a/languages/uk-UA/general/github.json b/languages/uk-UA/general/github.json deleted file mode 100644 index dfb2944a..00000000 --- a/languages/uk-UA/general/github.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "DESCRIPTION": "Показати інформацію про GitHub репозиторії старої версії JaBa!", - "USAGE": "{{prefix}}github", - "EXAMPLES": "{{prefix}}github", - "CLICK_HERE": "Натисніть сюди, щоб відкрити посилання", - "LANGUAGE": "Мова", - "OWNER": "Власник репозиторію" -} \ No newline at end of file diff --git a/languages/uk-UA/general/hastebin.json b/languages/uk-UA/general/hastebin.json deleted file mode 100644 index c282f819..00000000 --- a/languages/uk-UA/general/hastebin.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "DESCRIPTION": "Опублікувати текст на Hastebin!", - "USAGE": "{{prefix}}hastebin [текст]", - "EXAMPLES": "{{prefix}}hastebin Hello World!", - "MISSING_TEXT": "Введіть текст!", - "SUCCESS": "Успішно опубліковано!" -} \ No newline at end of file diff --git a/languages/uk-UA/general/invitations.json b/languages/uk-UA/general/invites.json similarity index 83% rename from languages/uk-UA/general/invitations.json rename to languages/uk-UA/general/invites.json index 2633f6d2..ebde8207 100644 --- a/languages/uk-UA/general/invitations.json +++ b/languages/uk-UA/general/invites.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Показати кількість користувачів, яких користувач запросив на сервер!", - "USAGE": "{{prefix}}invitations (@користувач)", - "EXAMPLES": "{{prefix}}invitations\n{{prefix}}invitations @Jonny_Bro#4226", + "USAGE": "{{prefix}}invites (@користувач)", + "EXAMPLES": "{{prefix}}invites\n{{prefix}}invites @Jonny_Bro#4226", "NOBODY_AUTHOR": "Ви нікого не запросили на сервер!", "NOBODY_MEMBER": "{{member}} нікого не запрошував(а) на сервер!", "CODE": "**{{code}}** ({{uses}} використань) | {{channel}}", diff --git a/languages/uk-UA/general/someone.json b/languages/uk-UA/general/someone.json deleted file mode 100644 index 3cab8b0c..00000000 --- a/languages/uk-UA/general/someone.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "DESCRIPTION": "Вибрати випадкового учасника на сервері!", - "USAGE": "{{prefix}}someone", - "EXAMPLES": "{{prefix}}someone" -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 867d7578..3c4995d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jaba", - "version": "3.4.5", + "version": "3.4.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jaba", - "version": "3.4.5", + "version": "3.4.6", "license": "ISC", "dependencies": { "@discordjs/opus": "^0.7.0", diff --git a/package.json b/package.json index 54156e16..e413cbd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jaba", - "version": "3.4.5", + "version": "3.4.6", "description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js", "main": "index.js", "private": true,