mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Discord.js v14
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { DataResolver } = require('discord.js');
|
||||
const { REST } = require('@discordjs/rest');
|
||||
const { Routes } = require('discord-api-types/v10');
|
||||
const { XIAO_TOKEN } = process.env;
|
||||
const rest = new REST({ version: '10' }).setToken(XIAO_TOKEN);
|
||||
const { DataResolver, Routes } = require('discord.js');
|
||||
|
||||
module.exports = class BannerCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,7 +21,7 @@ module.exports = class BannerCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
await rest.patch(Routes.user(), {
|
||||
await this.client.rest.patch(Routes.user(), {
|
||||
body: { banner: await DataResolver.resolveImage(image) }
|
||||
});
|
||||
return msg.say('Set the banner.');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const types = ['reject', 'info', 'approve'];
|
||||
const typesColors = ['RED', 'YELLOW', 'GREEN'];
|
||||
const displaytypes = ['❌ Rejected', '❓ Need More Info', '✅ Accepted/Fixed'];
|
||||
@@ -35,11 +35,11 @@ module.exports = class ReportRespondCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { user, type, message }) {
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescription(message)
|
||||
.setTitle(displaytypes[type])
|
||||
.setAuthor(msg.author.tag)
|
||||
.setFooter(`ID: ${msg.author.id}`)
|
||||
.setAuthor({ name: msg.author.tag })
|
||||
.setFooter({ text: `ID: ${msg.author.id}` })
|
||||
.setTimestamp()
|
||||
.setColor(typesColors[type]);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user