mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 00:04:48 +02:00
Discord.js v14
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
|
||||
module.exports = class EmbedCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -8,7 +8,7 @@ module.exports = class EmbedCommand extends Command {
|
||||
group: 'edit-text',
|
||||
memberName: 'embed',
|
||||
description: 'Sends text in an embed.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
clientPermissions: [PermissionFlagsBits.EmbedLinks],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
@@ -19,6 +19,6 @@ module.exports = class EmbedCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.embed(new MessageEmbed().setDescription(text));
|
||||
return msg.embed(new EmbedBuilder().setDescription(text));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ module.exports = class MockingCommand extends Command {
|
||||
|
||||
run(msg, { text }) {
|
||||
const canEmoji = msg.guild
|
||||
? msg.channel.permissionsFor(this.client.user).has('USE_EXTERNAL_EMOJIS')
|
||||
? msg.channel.permissionsFor(this.client.user).has(PermissionFlagsBits.UseExternalEmojis)
|
||||
: true;
|
||||
const letters = text.split('');
|
||||
for (let i = 0; i < letters.length; i += Math.floor(Math.random() * 4)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const translate = require('@vitalets/google-translate-api');
|
||||
const { list } = require('../../util/Util');
|
||||
const logos = require('../../assets/json/logos');
|
||||
@@ -14,7 +14,7 @@ module.exports = class TranslateCommand extends Command {
|
||||
memberName: 'translate',
|
||||
description: 'Translates text to a specific language.',
|
||||
details: `**Codes:** ${codes.join(', ')}`,
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
clientPermissions: [PermissionFlagsBits.EmbedLinks],
|
||||
credit: [
|
||||
{
|
||||
name: 'Google',
|
||||
@@ -54,9 +54,9 @@ module.exports = class TranslateCommand extends Command {
|
||||
|
||||
async run(msg, { text, target, base }) {
|
||||
const { text: result, from } = await translate(text, { to: target, from: base });
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0x4285F4)
|
||||
.setFooter('Powered by Google Translate', logos.googleTranslate)
|
||||
.setFooter({ text: 'Powered by Google Translate', iconURL: logos.googleTranslate })
|
||||
.addField(`❯ From: ${translate.languages[from.language.iso]}`, from.text.value || text)
|
||||
.addField(`❯ To: ${translate.languages[target]}`, result);
|
||||
return msg.embed(embed);
|
||||
|
||||
Reference in New Issue
Block a user