mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fixed missed stuff
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { PermissionFlagsBits } = require('discord.js');
|
||||
const { MOCKING_EMOJI_ID, MOCKING_EMOJI_NAME } = process.env;
|
||||
|
||||
module.exports = class MockingCommand extends Command {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { shorten } = require('../../util/Util');
|
||||
const logos = require('../../assets/json/logos');
|
||||
const { GOV_KEY } = process.env;
|
||||
|
||||
@@ -66,7 +66,11 @@ module.exports = class TwentyQuestionsCommand extends Command {
|
||||
const row = rows[Math.floor(i / 5)];
|
||||
const components = answers.slice(i, i + 5);
|
||||
for (const component of components) {
|
||||
row.addComponents(new ButtonBuilder().setCustomId(component).setStyle(ButtonStyle.Primary).setLabel(component));
|
||||
const button = new ButtonBuilder()
|
||||
.setCustomId(component)
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setLabel(component);
|
||||
row.addComponents(button);
|
||||
}
|
||||
}
|
||||
const sRow = new ActionRowBuilder();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const request = require('node-superfetch');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const logos = require('../../assets/json/logos');
|
||||
|
||||
@@ -34,7 +34,10 @@ module.exports = class AvatarCommand extends Command {
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(user.tag)
|
||||
.setDescription(
|
||||
formats.map(fmt => embedURL(displayFmts[fmt], user.displayAvatarURL({ extension: fmt, size: 2048 }))).join(' | ')
|
||||
formats.map(fmt => {
|
||||
const avatar = user.displayAvatarURL({ extension: fmt, size: 2048 });
|
||||
return embedURL(displayFmts[fmt], avatar);
|
||||
}).join(' | ')
|
||||
)
|
||||
.setImage(user.displayAvatarURL({ format, size: 2048 }))
|
||||
.setColor(0x00AE86);
|
||||
|
||||
@@ -2,6 +2,7 @@ const Command = require('../../framework/Command');
|
||||
const { PermissionFlagsBits } = require('discord.js');
|
||||
const { joinVoiceChannel } = require('@discordjs/voice');
|
||||
const Dispatcher = require('../../structures/Dispatcher');
|
||||
const perms = [PermissionFlagsBits.Connect, PermissionFlagsBits.Speak, PermissionFlagsBits.ViewChannel];
|
||||
|
||||
module.exports = class JoinCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -20,7 +21,7 @@ module.exports = class JoinCommand extends Command {
|
||||
run(msg) {
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
if (!voiceChannel) return msg.reply('Please enter a voice channel first.');
|
||||
if (!voiceChannel.permissionsFor(this.client.user).has([PermissionFlagsBits.Connect, PermissionFlagsBits.Speak, 'VIEW_CHANNEL'])) {
|
||||
if (!voiceChannel.permissionsFor(this.client.user).has(perms)) {
|
||||
return msg.reply('I\'m missing the "Connect", "Speak", or "View Channel" permission for this channel.');
|
||||
}
|
||||
if (!voiceChannel.joinable) return msg.reply('Your voice channel is not joinable.');
|
||||
|
||||
@@ -59,15 +59,11 @@ module.exports = [
|
||||
type: ActivityType.Playing
|
||||
},
|
||||
{
|
||||
text: (client) => `${formatNumber(client.guilds.cache.size)} servers`,
|
||||
text: client => `${formatNumber(client.guilds.cache.size)} servers`,
|
||||
type: ActivityType.Watching
|
||||
},
|
||||
{
|
||||
text: (client) => `with ${formatNumber(client.registry.commands.size)} commands`,
|
||||
text: client => `with ${formatNumber(client.registry.commands.size)} commands`,
|
||||
type: ActivityType.Playing
|
||||
},
|
||||
{
|
||||
text: (client) => `${formatNumber(client.channels.cache.size)} channels`,
|
||||
type: ActivityType.Watching
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user