From f5236a04e6211b8f9c49e9a66c1d36ba00edb144 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sat, 23 Jul 2022 17:19:18 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=85=D1=83=D0=B9=20=D0=BD=D0=B5=20=D0=BD=D1=83?= =?UTF-8?q?=D0=B6=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/General/invite.js | 4 +-- commands/General/userinfo.js | 19 ------------- config.sample.js | 8 ------ emojis.json | 1 - events/ready.js | 4 --- helpers/discordbots.org.js | 41 --------------------------- languages/en-US/general/invite.json | 1 - languages/en-US/general/userinfo.json | 3 +- languages/en-US/misc.json | 2 -- languages/en-US/music/stop.json | 1 - languages/ru-RU/general/invite.json | 1 - languages/ru-RU/general/userinfo.json | 3 +- languages/ru-RU/misc.json | 2 -- languages/uk-UA/general/invite.json | 1 - languages/uk-UA/general/userinfo.json | 3 +- languages/uk-UA/misc.json | 2 -- scripts/verify-config.js | 16 ----------- 17 files changed, 4 insertions(+), 108 deletions(-) delete mode 100644 helpers/discordbots.org.js diff --git a/commands/General/invite.js b/commands/General/invite.js index 04b1910c..e7e08a95 100644 --- a/commands/General/invite.js +++ b/commands/General/invite.js @@ -8,7 +8,7 @@ class Invite extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: ["i", "add", "vote"], + aliases: ["i"], memberPermissions: [], botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], nsfw: false, @@ -23,7 +23,6 @@ class Invite extends Command { permissions: [Discord.Permissions.FLAGS.ADMINISTRATOR] }); const donateLink = "https://qiwi.com/n/JONNYBRO/"; - // const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`; if (args[0] && args[0] === "copy") return message.reply({ content: inviteLink @@ -42,7 +41,6 @@ class Invite extends Command { .addField(message.translate("general/invite:SUPPORT"), message.translate("general/invite:CLICK", { link: donateLink }) + `\n*для других способов пишите в ЛС <@${data.config.owner.id}> (указывайте ваш Discord тэг чтобы я мог выдать вам ачивку)*`) - // .addField(message.translate("general/invite:VOTE"), voteURL) .setColor(data.config.embed.color) .setFooter({ text: data.config.embed.footer diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index f8ba012d..c11625fc 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -86,25 +86,6 @@ class Userinfo extends Command { }) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", "))); } - if (user.bot && data.config.apiKeys.dbl && (data.config.apiKeys.dbl !== "")) { - const res = await fetch("https://discordbots.org/api/bots/" + user.id, { - headers: { - "Authorization": data.config.apiKeys.dbl - } - }); - const data = await res.json(); - if (!data.error) { - embed.addField(this.client.customEmojis.desc + " " + message.translate("common:DESCRIPTION"), data.shortdesc, true) - .addField(this.client.customEmojis.stats + " " + message.translate("common:STATS"), message.translate("general/userinfo:BOT_STATS", { - votes: data.monthlyPoints || 0, - servers: data.server_count || 0, - shards: (data.shards || [0]).length, - lib: data.lib || "unknown" - }), true) - .addField(this.client.customEmojis.link + " " + message.translate("common:LINKS"), `${data.support ? `[${message.translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${message.translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${message.translate("common:WEBSITE")}](${data.website})` : ""}`, true); - } - } - message.reply({ embeds: [embed] }); diff --git a/config.sample.js b/config.sample.js index a377c703..08e73e76 100644 --- a/config.sample.js +++ b/config.sample.js @@ -28,18 +28,10 @@ module.exports = { id: "XXXXXXXXXXX", // The ID of the bot's owner name: "@XXXXXXXXXXX#1234" // And the name of the bot's owner }, - /* DBL votes webhook (optional) */ - votes: { - port: 5000, // The port for the server - password: "XXXXXXXXXXX", // The webhook auth that you have defined on discordbots.org - channel: "XXXXXXXXXXX" // The ID of the channel that in you want the votes logs - }, /* The API keys that are required for certain commands */ apiKeys: { // BLAGUE.XYZ: https://blague.xyz/ blagueXYZ: "XXXXXXXXXXX", - // DBL: https://discordbots.org/api/docs#mybots - dbl: "XXXXXXXXXXX", // AMETHYSTE: https://api.amethyste.moe amethyste: "XXXXXXXXXXX" }, diff --git a/emojis.json b/emojis.json index b3962b37..31d92b0f 100644 --- a/emojis.json +++ b/emojis.json @@ -8,7 +8,6 @@ "link": "<:atlanta_link:598176933855100976>", "voice": "<:atlanta_voice:598176518891372560>", "add": "<:atlanta_add:598176235700355083>", - "vote": "<:atlanta_vote:598175768274665492>", "help": "<:atlanta_help:598175335078559771>", "warn": "<:atlanta_warn:598179558927106058>", "error": "<:atlanta_error:736144198318686278>", diff --git a/events/ready.js b/events/ready.js index 60a71937..c68df7ef 100644 --- a/events/ready.js +++ b/events/ready.js @@ -24,10 +24,6 @@ module.exports = class { const birthdays = require("../helpers/birthdays"); birthdays.init(client); - // DiscordBots.org STATS - const discordbotsorg = require("../helpers/discordbots.org"); - discordbotsorg.init(client); - // Unmute users const checkUnmutes = require("../helpers/checkUnmutes"); checkUnmutes.init(client); diff --git a/helpers/discordbots.org.js b/helpers/discordbots.org.js deleted file mode 100644 index 3f7f7ae9..00000000 --- a/helpers/discordbots.org.js +++ /dev/null @@ -1,41 +0,0 @@ -const DBL = require("dblapi.js"); - -/* THIS POSTS STATS TO DISCORDBOTS.ORG */ -module.exports = { - /** - * Starts to post stats to DBL - * @param {object} client The Discord Client instance - */ - init(client) { - if (client.config.apiKeys.dbl && client.config.apiKeys.dbl !== "") { - const stats = new DBL(client.config.apiKeys.dbl, client); - setInterval(function () { - stats.postStats(client.guilds.cache.size); - }, 10 * 60000); // every 10 minutes - const dbl = new DBL(client.config.apiKeys.dbl, { - webhookPort: client.config.votes.port, - webhookAuth: client.config.votes.password - }); - dbl.webhook.on("vote", async (vote) => { - const dUser = await client.users.fetch(vote.user); - const member = await client.findOrCreateMember({ - id: vote.user, - guildID: client.config.support.id - }); - member.money = member.money + 50; - member.save(); - dUser.send(client.translate("misc:VOTE_DM", { - user: dUser.tag - })).catch(() => {}); - const logsChannel = client.channels.cache.get(client.config.votes.channel); - - if (logsChannel) logsChannel.send({ - content: client.translate("misc:VOTE_LOGS", { - userid: dUser.id, - usertag: dUser.tag - }) - }); - }); - } - } -}; \ No newline at end of file diff --git a/languages/en-US/general/invite.json b/languages/en-US/general/invite.json index 1e58f9aa..0100924f 100644 --- a/languages/en-US/general/invite.json +++ b/languages/en-US/general/invite.json @@ -6,6 +6,5 @@ "CLICK": "[**Click**]({{link}})", "TIP": "Send `{{prefix}}invite copy` to be able to copy the invite link!", "ADD": "Invite JaBa", - "VOTE": "Vote for JaBa", "SUPPORT": "Support developer" } \ No newline at end of file diff --git a/languages/en-US/general/userinfo.json b/languages/en-US/general/userinfo.json index a82d11c3..bffa7e1b 100644 --- a/languages/en-US/general/userinfo.json +++ b/languages/en-US/general/userinfo.json @@ -6,6 +6,5 @@ "NO_GAME": "Not playing", "NO_ROLE": "No role", "NO_NICKNAME": "No nickname", - "MORE_ROLES": "and {{count}} others roles", - "BOT_STATS": "**{{votes}}** votes ([top.gg](https://top.gg))\n**{{servers}}** servers\n**{{shards}}** shards\nUsing **{{lib}}**" + "MORE_ROLES": "and {{count}} others roles" } \ No newline at end of file diff --git a/languages/en-US/misc.json b/languages/en-US/misc.json index 8da7f8c1..c5b98711 100644 --- a/languages/en-US/misc.json +++ b/languages/en-US/misc.json @@ -14,8 +14,6 @@ "NO_PERMS": "You must have an administration rights to perform this action!", "NO_REASON_PROVIDED": "No reason provided", "NO_USER_FOUND_ID": "No user on Discord has the ID `{{id}}`!", - "VOTE_DM": "⬆️ Hello {{user}}, thanks for voting!\nHere's your reward: 40 credits (on the support server)!", - "VOTE_LOGS": "⬆️ **{{usertag}}** (`{{userid}}`) voted for **JaBa** and won **40** credits, thank you!\n", "HELLO_SERVER": "Hello **{{username}}**, my prefix on this server is `{{prefix}}`. Use `{{prefix}}help` to get the list of the commands!", "HELLO_DM": "Hello, as you are currently in direct message you don't need to add a prefix before command name.", "GUILD_ONLY": "This command is only available on a server!", diff --git a/languages/en-US/music/stop.json b/languages/en-US/music/stop.json index fd1565d3..27e97ad1 100644 --- a/languages/en-US/music/stop.json +++ b/languages/en-US/music/stop.json @@ -2,6 +2,5 @@ "DESCRIPTION": "Stop the music", "USAGE": "{{prefix}}stop", "EXAMPLES": "{{prefix}}stop", - "VOTE_CONTENT": "React with 👍 to stop the music! {{requiredCount}} more votes are required.", "SUCCESS": "Music stopped!" } \ No newline at end of file diff --git a/languages/ru-RU/general/invite.json b/languages/ru-RU/general/invite.json index 28750e97..f3d323b8 100644 --- a/languages/ru-RU/general/invite.json +++ b/languages/ru-RU/general/invite.json @@ -6,6 +6,5 @@ "CLICK": "[**Тык**]({{link}})", "TIP": "Отправьте `{{prefix}}invite copy`, чтобы получить ссылку для копирования!", "ADD": "Пригласить JaBa", - "VOTE": "Проголосовать за JaBa", "SUPPORT": "Поддержать разработчика" } \ No newline at end of file diff --git a/languages/ru-RU/general/userinfo.json b/languages/ru-RU/general/userinfo.json index ef99ba79..4dd8157a 100644 --- a/languages/ru-RU/general/userinfo.json +++ b/languages/ru-RU/general/userinfo.json @@ -7,6 +7,5 @@ "NO_ROLE": "Нет роли", "ROLE": "Высшая роль", "NO_NICKNAME": "Нет никнейма", - "MORE_ROLES": "и ещё {{count}} роль(и/ей)", - "BOT_STATS": "**{{votes}}** голосов ([top.gg](https://top.gg))\n**{{servers}}** серверов\n**{{shards}}** шардов\nИспользует **{{lib}}**" + "MORE_ROLES": "и ещё {{count}} роль(и/ей)" } \ No newline at end of file diff --git a/languages/ru-RU/misc.json b/languages/ru-RU/misc.json index 209d395c..9210d807 100644 --- a/languages/ru-RU/misc.json +++ b/languages/ru-RU/misc.json @@ -15,8 +15,6 @@ "NO_PERMS": "Недостаточно прав для выполнения данного действия!", "NO_REASON_PROVIDED": "Причина не указана", "NO_USER_FOUND_ID": "Пользователя с ID `{{id}}` не существует!", - "VOTE_DM": "⬆️ Привет, {{user}}, спасибо за голос!\nТвоя награда - 50 кредитов (на сервере поддержки)!", - "VOTE_LOGS": "⬆️ **{{usertag}}** (`{{userid}}`) проголосовал за **JaBa** и получил **50** кредитов, спасибо!\n", "HELLO_SERVER": "Привет, **{{username}}**, мой префикс на данном сервере - `{{prefix}}`. Используйте `{{prefix}}help`, чтобы получить список команд!", "HELLO_DM": "Привет, так как вы пишите в ЛС, вам не нужно использовать префикс.", "GUILD_ONLY": "Данную команду можно использовать только на сервере!", diff --git a/languages/uk-UA/general/invite.json b/languages/uk-UA/general/invite.json index b7e3697d..d5f0fc7a 100644 --- a/languages/uk-UA/general/invite.json +++ b/languages/uk-UA/general/invite.json @@ -6,6 +6,5 @@ "CLICK": "[**Тик**]({{link}})", "TIP": "Відправте `{{prefix}}invite copy`, щоб отримати посилання для копіювання!", "ADD": "Запросити JaBa", - "VOTE": "Проголосувати за JaBa", "SUPPORT": "Підтримати розробника" } \ No newline at end of file diff --git a/languages/uk-UA/general/userinfo.json b/languages/uk-UA/general/userinfo.json index 5f2f5c45..c0c8ccd6 100644 --- a/languages/uk-UA/general/userinfo.json +++ b/languages/uk-UA/general/userinfo.json @@ -7,6 +7,5 @@ "NO_ROLE": "Немає ролі", "ROLE": "Вища роль", "NO_NICKNAME": "Немає нікнейму", - "MORE_ROLES": "і ще {{count}} роль(і/ей)", - "BOT_STATS": "**{{votes}}** голосів ([top.gg](https://top.gg))\n**{{servers}}** серверів\n**{{shards }}** шардів\nВикористовує **{{lib}}**" + "MORE_ROLES": "і ще {{count}} роль(і/ей)" } \ No newline at end of file diff --git a/languages/uk-UA/misc.json b/languages/uk-UA/misc.json index 4fb3cb24..42ec3f25 100644 --- a/languages/uk-UA/misc.json +++ b/languages/uk-UA/misc.json @@ -15,8 +15,6 @@ "NO_PERMS": "Недостатньо прав для виконання цієї дії!", "NO_REASON_PROVIDED": "Причина не вказана", "NO_USER_FOUND_ID": "Користувача з ID `{{id}}` не існує!", - "VOTE_DM": "⬆️ Привіт, {{user}}, дякую за голос!\nТвоя нагорода - 50 кредитів (на сервері підтримки)!", - "VOTE_LOGS": "⬆️ **{{usertag}}** (`{{userid}}`) проголосував за **JaBa** і отримав **50** кредитів, дякую!\n", "HELLO_SERVER": "Привіт, **{{username}}**, мій префікс на даному сервері - `{{prefix}}`. Використовуйте `{{prefix}}help`, щоб отримати список команд!", "HELLO_DM": "Привіт, тому що ви пишете в ОП, вам не потрібно використовувати префікс.", "GUILD_ONLY": "Цю команду можна використовувати лише на сервері!", diff --git a/scripts/verify-config.js b/scripts/verify-config.js index 4cc801cf..20982952 100644 --- a/scripts/verify-config.js +++ b/scripts/verify-config.js @@ -94,22 +94,6 @@ const checks = [ success("Valid blague.xyz key"); } } - if (!config.apiKeys.dbl) { - ignore("DBL API is not configured, key should not be checked."); - } else { - const res = await fetch("https://top.gg/api/bots/check?userId=test", { - method: "POST", - headers: { - Authorization: config.apiKeys.dbl - } - }); - const result = await res.json(); - if (result.error && result.error === "Unauthorized") { - error("Should be a valid DBL key", "get your key here: https://top.gg/ OR delete the key from the config if you don't have a key"); - } else { - success("Valid DBL key"); - } - } resolve(); }); },