From 00b37379f5c59b72d1274477bf2a4823602db6b5 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Fri, 7 Jul 2023 21:50:36 +0500 Subject: [PATCH] update 8ball --- commands/Fun/8ball.js | 28 ++++++++++++++++++++++------ dashboard/dashboard.js | 2 +- dashboard/docs/updates.md | 3 +++ helpers/birthdays.js | 2 +- languages/en-US/fun/8ball.json | 4 ++-- languages/ru-RU/fun/8ball.json | 4 ++-- languages/uk-UA/fun/8ball.json | 4 ++-- 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index a479d28b..ec678bfc 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder } = require("discord.js"); +const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Eightball extends BaseCommand { @@ -48,13 +48,29 @@ class Eightball extends BaseCommand { await interaction.deferReply(); const question = interaction.options.getString("question"); - const answer = interaction.translate(`fun/8ball:RESPONSE_${client.functions.randomNum(1, 20)}`); + const embed = new EmbedBuilder() + .setTitle(interaction.translate("fun/8ball:DESCRIPTION")) + .setAuthor({ + name: client.user.getUsername(), + iconURL: client.user.displayAvatarURL(), + }) + .setFields( + { + name: interaction.translate("fun/8ball:QUESTION"), + value: question, + }, + { + name: interaction.translate("fun/8ball:ANSWER"), + value: interaction.translate(`fun/8ball:RESPONSE_${client.functions.randomNum(1, 20)}`), + }, + ) + .setColor(client.config.embed.color) + .setFooter(client.config.embed.footer) + .setTimestamp(); + await client.wait(5000); - interaction.replyT("fun/8ball:ANSWER", { - question, - answer, - }, { edit: true }); + interaction.editReply({ embeds: [embed] }); } } diff --git a/dashboard/dashboard.js b/dashboard/dashboard.js index d6599070..b0ae2fa8 100644 --- a/dashboard/dashboard.js +++ b/dashboard/dashboard.js @@ -151,7 +151,7 @@ module.exports.load = async client => { }; }, }, - websiteName: `${client.user.username} Dashboard`, + websiteName: `${client.user.getUsername()} Dashboard`, colorScheme: "blue", supporteMail: "", icons: { diff --git a/dashboard/docs/updates.md b/dashboard/docs/updates.md index 00664b05..46078d8a 100644 --- a/dashboard/docs/updates.md +++ b/dashboard/docs/updates.md @@ -7,6 +7,9 @@ С помощью команд *adduser* и *removeuser* можно добавлять и убирать людей из тикета соответственно.\ *closeticket* позволяет принудительно закрыть тикет. +* Изменено + * Внешний вид *8ball*. + ### JaBa v4.3.1 * Добавлено * Мониторинг изменения сообщений!\ diff --git a/helpers/birthdays.js b/helpers/birthdays.js index ba2a16cf..cd84d5ca 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -30,7 +30,7 @@ module.exports.init = async function (client) { if (currentMonth === month && currentDay === day) { const embed = new EmbedBuilder() .setAuthor({ - name: client.user.username, + name: client.user.getUsername(), iconURL: client.user.displayAvatarURL(), }) .setColor(client.config.embed.color) diff --git a/languages/en-US/fun/8ball.json b/languages/en-US/fun/8ball.json index 16953f6a..4631c6be 100644 --- a/languages/en-US/fun/8ball.json +++ b/languages/en-US/fun/8ball.json @@ -1,9 +1,9 @@ { "DESCRIPTION": "I tell the truth", "USAGE": "[question]", - "QUESTION": "Question", "EXAMPLES": "8ball question:Is JaBa awesome?", - "ANSWER": "**Question:** {{question}}\n**Answer:** {{answer}}", + "QUESTION": "Question", + "ANSWER": "Answer", "RESPONSE_1": "It is certain", "RESPONSE_2": "It is decidedly so", "RESPONSE_3": "Without a doubt", diff --git a/languages/ru-RU/fun/8ball.json b/languages/ru-RU/fun/8ball.json index c099ab99..909fa0dd 100644 --- a/languages/ru-RU/fun/8ball.json +++ b/languages/ru-RU/fun/8ball.json @@ -1,9 +1,9 @@ { "DESCRIPTION": "Я говорю правду", "USAGE": "[question]", - "QUESTION": "Вопрос", "EXAMPLES": "8ball question:JaBa крутой?", - "ANSWER": "**Вопрос:** {{question}}\n**Ответ:** {{answer}}", + "QUESTION": "Вопрос", + "ANSWER": "Ответ", "RESPONSE_1": "Бесспорно", "RESPONSE_2": "Предрешено", "RESPONSE_3": "Никаких сомнений", diff --git a/languages/uk-UA/fun/8ball.json b/languages/uk-UA/fun/8ball.json index 97809b2a..16963017 100644 --- a/languages/uk-UA/fun/8ball.json +++ b/languages/uk-UA/fun/8ball.json @@ -1,9 +1,9 @@ { "DESCRIPTION": "Я говорю правду", "USAGE": "[question]", - "QUESTION": "Питання", "EXAMPLES": "8ball question:JaBa крутий?", - "ANSWER": "**Питання:** {{question}}\n**Відповідь:** {{answer}}", + "QUESTION": "Питання", + "ANSWER": "Відповідь", "RESPONSE_1": "Безперечно", "RESPONSE_2": "Вирішено", "RESPONSE_3": "Ніяких сумнівів",