mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 13:14:15 +02:00
refactor(arabot): change deprecated reply options
This commit is contained in:
parent
2207d996a1
commit
0419488b6f
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType } from 'discord.js';
|
||||
import { ChannelType, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class AccessCommand extends Command {
|
||||
@ -79,7 +79,7 @@ export class AccessCommand extends Command {
|
||||
if (!interaction.inCachedGuild()) {
|
||||
await interaction.reply({
|
||||
content: 'This command can only be run in a server!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -94,7 +94,7 @@ export class AccessCommand extends Command {
|
||||
if (user === null && role === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching slash command data!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -104,7 +104,7 @@ export class AccessCommand extends Command {
|
||||
await interaction.reply({
|
||||
content:
|
||||
'You have entered a user and a role at the same time! Please only enter one at a time.',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -116,7 +116,7 @@ export class AccessCommand extends Command {
|
||||
) {
|
||||
await interaction.reply({
|
||||
content: 'Please only select a text or voice channel!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -129,7 +129,7 @@ export class AccessCommand extends Command {
|
||||
) {
|
||||
await interaction.reply({
|
||||
content: 'Channel is not in ModMail/Private/Restricted category!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -143,7 +143,7 @@ export class AccessCommand extends Command {
|
||||
} else {
|
||||
await interaction.reply({
|
||||
content: 'Could not find the role to edit permissions!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -185,7 +185,7 @@ export class AccessCommand extends Command {
|
||||
default:
|
||||
await interaction.reply({
|
||||
content: 'Incorrect permission option!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -220,7 +220,7 @@ export class AccessCommand extends Command {
|
||||
default:
|
||||
await interaction.reply({
|
||||
content: 'Incorrect permission option!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { Message, MessageFlagsBitField } from 'discord.js';
|
||||
|
||||
export class ClearCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
@ -60,8 +60,8 @@ export class ClearCommand extends Command {
|
||||
if (channel === null || channel.isDMBased()) {
|
||||
await interaction.reply({
|
||||
content: 'Could not fetch channel!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -70,8 +70,8 @@ export class ClearCommand extends Command {
|
||||
|
||||
await interaction.reply({
|
||||
content: `Successfully deleted ${messages} messages!`,
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,12 @@
|
||||
|
||||
import { RegisterBehavior } from '@sapphire/framework';
|
||||
import { Subcommand } from '@sapphire/plugin-subcommands';
|
||||
import type { Guild, TextChannel, Snowflake } from 'discord.js';
|
||||
import {
|
||||
Guild,
|
||||
TextChannel,
|
||||
Snowflake,
|
||||
MessageFlagsBitField,
|
||||
} from 'discord.js';
|
||||
import {
|
||||
CategoryChannel,
|
||||
ChannelType,
|
||||
@ -93,7 +98,9 @@ export class PrivateCommand extends Subcommand {
|
||||
const modUser = interaction.user;
|
||||
const { guild } = interaction;
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (guild === null) {
|
||||
@ -235,7 +242,9 @@ export class PrivateCommand extends Subcommand {
|
||||
const modUser = interaction.user;
|
||||
const { guild, channel } = interaction;
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (guild === null || channel === null) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { User, Guild, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { getBalance } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
@ -50,7 +50,7 @@ export class BalanceCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find the guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -66,15 +66,9 @@ export class BalanceCommand extends Command {
|
||||
}
|
||||
|
||||
public async messageRun(message: Message) {
|
||||
const user = message.member?.user;
|
||||
const user = message.author;
|
||||
const { guild } = message;
|
||||
|
||||
if (user === undefined) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find your user!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (guild === null) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find the guild!');
|
||||
|
@ -19,7 +19,13 @@
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { Time } from '@sapphire/time-utilities';
|
||||
import type { User, Guild, GuildMember, Message } from 'discord.js';
|
||||
import {
|
||||
User,
|
||||
Guild,
|
||||
GuildMember,
|
||||
Message,
|
||||
MessageFlagsBitField,
|
||||
} from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { daily, getLastDaily } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
@ -51,7 +57,7 @@ export class DailyCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find the guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -67,15 +73,9 @@ export class DailyCommand extends Command {
|
||||
}
|
||||
|
||||
public async messageRun(message: Message) {
|
||||
const user = message.member?.user;
|
||||
const user = message.author;
|
||||
const { guild } = message;
|
||||
|
||||
if (user === undefined) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find your user!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (guild === null) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find the guild!');
|
||||
|
@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { User, Guild, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { getBalance, transfer } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class BalanceCommand extends Command {
|
||||
@ -75,7 +75,7 @@ export class BalanceCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find the guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -117,15 +117,9 @@ export class BalanceCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
const user = message.member?.user;
|
||||
const user = message.author;
|
||||
const { guild } = message;
|
||||
|
||||
if (user === undefined) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find your user!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (guild === null) {
|
||||
await message.react('❌');
|
||||
await message.reply('Could not find the guild!');
|
||||
@ -206,20 +200,28 @@ export class BalanceCommand extends Command {
|
||||
info.embeds.push(embed);
|
||||
|
||||
// Log the payment in the server
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.economy) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.economy);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(IDs.channels.logs.economy)) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
if (logChannel === undefined) {
|
||||
this.container.logger.error('Pay Error: Could not fetch log channel');
|
||||
const fetchLogChannel = await guild.channels
|
||||
.fetch(IDs.channels.logs.economy)
|
||||
.catch(() => undefined);
|
||||
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Pay: Could not fetch log channel');
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Pay: the bot does not have permission to send in the log channel',
|
||||
);
|
||||
return info;
|
||||
}
|
||||
|
||||
const logEmbed = new EmbedBuilder(embed.data);
|
||||
logEmbed.setTimestamp().setFooter({ text: `ID: ${user.id}` });
|
||||
await logChannel.send({ embeds: [logEmbed] });
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { N1984 } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
@ -50,8 +50,8 @@ export class N1984Command extends Command {
|
||||
// Type checks
|
||||
if (!(member instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -79,6 +79,6 @@ export class N1984Command extends Command {
|
||||
.setFooter({ text: embedFooter });
|
||||
|
||||
// Send the embed
|
||||
await interaction.reply({ embeds: [n1984Embed], fetchReply: true });
|
||||
await interaction.reply({ embeds: [n1984Embed], withResponse: true });
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Cringe } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
@ -49,8 +49,8 @@ export class CringeCommand extends Command {
|
||||
// Type check
|
||||
if (!(member instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -74,6 +74,6 @@ export class CringeCommand extends Command {
|
||||
.setFooter({ text: embedFooter });
|
||||
|
||||
// Send the embed
|
||||
await interaction.reply({ embeds: [cringeEmbed], fetchReply: true });
|
||||
await interaction.reply({ embeds: [cringeEmbed], withResponse: true });
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Happy } from '#utils/gifs';
|
||||
|
||||
export class HappyCommand extends Command {
|
||||
@ -48,8 +48,8 @@ export class HappyCommand extends Command {
|
||||
// Type checks
|
||||
if (!(member instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -62,6 +62,6 @@ export class HappyCommand extends Command {
|
||||
.setImage(randomHappy);
|
||||
|
||||
// Send the embed
|
||||
await interaction.reply({ embeds: [happyEmbed], fetchReply: true });
|
||||
await interaction.reply({ embeds: [happyEmbed], withResponse: true });
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Hugs } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
@ -60,8 +60,8 @@ export class HugCommand extends Command {
|
||||
|
||||
if (!(hugger instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -96,7 +96,7 @@ export class HugCommand extends Command {
|
||||
await interaction.reply({
|
||||
content: `${user}`,
|
||||
embeds: [hugEmbed],
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Kill } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
@ -59,8 +59,8 @@ export class KillCommand extends Command {
|
||||
// Type checks
|
||||
if (!(sender instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -92,7 +92,7 @@ export class KillCommand extends Command {
|
||||
await interaction.reply({
|
||||
content: `${user}`,
|
||||
embeds: [killEmbed],
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Poke } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
@ -59,8 +59,8 @@ export class PokeCommand extends Command {
|
||||
// Type checks
|
||||
if (!(sender instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -95,7 +95,7 @@ export class PokeCommand extends Command {
|
||||
await interaction.reply({
|
||||
content: `${user}`,
|
||||
embeds: [pokeEmbed],
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Sad } from '#utils/gifs';
|
||||
|
||||
export class SadCommand extends Command {
|
||||
@ -48,8 +48,8 @@ export class SadCommand extends Command {
|
||||
// Type checks
|
||||
if (!(member instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -62,6 +62,6 @@ export class SadCommand extends Command {
|
||||
.setImage(randomSad);
|
||||
|
||||
// Send the embed
|
||||
await interaction.reply({ embeds: [sadEmbed], fetchReply: true });
|
||||
await interaction.reply({ embeds: [sadEmbed], withResponse: true });
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { EmbedBuilder, GuildMember, MessageFlagsBitField } from 'discord.js';
|
||||
import { Shrug } from '#utils/gifs';
|
||||
|
||||
export class ShrugCommand extends Command {
|
||||
@ -48,8 +48,8 @@ export class ShrugCommand extends Command {
|
||||
// Type checks
|
||||
if (!(member instanceof GuildMember)) {
|
||||
await interaction.reply({
|
||||
ephemeral: true,
|
||||
content: 'Failed to fetch your user on the bot!',
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -62,6 +62,6 @@ export class ShrugCommand extends Command {
|
||||
.setImage(randomShrug);
|
||||
|
||||
// Send the embed
|
||||
await interaction.reply({ embeds: [shrugEmbed], fetchReply: true });
|
||||
await interaction.reply({ embeds: [shrugEmbed], withResponse: true });
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,13 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Message, Snowflake, TextChannel, Guild } from 'discord.js';
|
||||
import {
|
||||
User,
|
||||
Message,
|
||||
Snowflake,
|
||||
Guild,
|
||||
MessageFlagsBitField,
|
||||
} from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { addBan, checkBan } from '#utils/database/moderation/ban';
|
||||
@ -75,13 +81,15 @@ export class BanCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const ban = await this.ban(user.id, mod.id, reason, guild);
|
||||
|
||||
@ -206,21 +214,32 @@ export class BanCommand extends Command {
|
||||
info.success = true;
|
||||
|
||||
// Log the ban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(
|
||||
const fetchLogChannel = await guild.channels.fetch(
|
||||
IDs.channels.logs.restricted,
|
||||
)) as TextChannel | undefined;
|
||||
if (logChannel === undefined) {
|
||||
this.container.logger.error('Ban Error: Could not fetch log channel');
|
||||
);
|
||||
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Ban: Could not fetch log channel');
|
||||
info.message = `${user} has been banned. This hasn't been logged in a text channel as log channel could not be found`;
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Ban: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message = `${user} has been banned. This hasn't been logged in a text channel as the bot does not have permission to send logs!`;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const log = new EmbedBuilder()
|
||||
.setColor('#FF0000')
|
||||
.setAuthor({
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { Duration, DurationFormatter } from '@sapphire/time-utilities';
|
||||
import type { User, Snowflake, TextChannel, Guild } from 'discord.js';
|
||||
import { User, Snowflake, Guild, MessageFlagsBitField } from 'discord.js';
|
||||
import { EmbedBuilder, Message } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { addTempBan, checkTempBan } from '#utils/database/moderation/tempBan';
|
||||
@ -79,8 +79,8 @@ export class TempBanCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -94,7 +94,9 @@ export class TempBanCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const ban = await this.ban(user.id, mod.id, time, reason, guild);
|
||||
|
||||
@ -273,25 +275,37 @@ export class TempBanCommand extends Command {
|
||||
info.success = true;
|
||||
|
||||
// Log the ban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(
|
||||
const fetchLogChannel = await guild.channels.fetch(
|
||||
IDs.channels.logs.restricted,
|
||||
)) as TextChannel | undefined;
|
||||
if (logChannel === undefined) {
|
||||
this.container.logger.error(
|
||||
'Temp Ban Error: Could not fetch log channel',
|
||||
);
|
||||
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Temp Ban: Could not fetch log channel');
|
||||
|
||||
info.message =
|
||||
`${user} has been temporarily banned for ${banLength}. ` +
|
||||
"This hasn't been logged in a text channel as log channel could not be found";
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Temp Ban: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message =
|
||||
`${user} has been temporarily banned for ${banLength}. ` +
|
||||
"This hasn't been logged in a text channel as the bot does not have permission to send logs!";
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const log = new EmbedBuilder()
|
||||
.setColor('#FF0000')
|
||||
.setAuthor({
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type {
|
||||
import {
|
||||
User,
|
||||
Message,
|
||||
Snowflake,
|
||||
TextChannel,
|
||||
Guild,
|
||||
GuildBan,
|
||||
MessageFlagsBitField,
|
||||
} from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
@ -75,8 +75,8 @@ export class UnbanCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -191,21 +191,32 @@ export class UnbanCommand extends Command {
|
||||
info.success = true;
|
||||
|
||||
// Log unban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(
|
||||
const fetchLogChannel = await guild.channels.fetch(
|
||||
IDs.channels.logs.restricted,
|
||||
)) as TextChannel | undefined;
|
||||
if (logChannel === undefined) {
|
||||
this.container.logger.error('Ban Error: Could not fetch log channel');
|
||||
info.message = `${user} has been banned. This hasn't been logged in a text channel as log channel could not be found`;
|
||||
);
|
||||
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Unban Error: Could not fetch log channel');
|
||||
info.message = `${user} has been unbanned. This hasn't been logged in a text channel as log channel could not be found`;
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Unban: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message = `${user} has been unbanned. This hasn't been logged in a text channel as the bot does not have permission to send logs!`;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const log = new EmbedBuilder()
|
||||
.setColor('#28A745')
|
||||
.setAuthor({
|
||||
|
@ -25,6 +25,7 @@ import {
|
||||
ChannelType,
|
||||
GuildMember,
|
||||
Message,
|
||||
MessageFlagsBitField,
|
||||
PermissionsBitField,
|
||||
} from 'discord.js';
|
||||
import type { TextChannel, Snowflake } from 'discord.js';
|
||||
@ -93,8 +94,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (interaction.guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Guild not found!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -105,8 +106,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (channel === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Channel not found!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -115,8 +116,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (channel.type !== ChannelType.GuildText) {
|
||||
await interaction.reply({
|
||||
content: 'Channel is not a text channel!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -128,8 +129,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (channel.parentId !== IDs.categories.diversity) {
|
||||
await interaction.reply({
|
||||
content: 'Command was not run in the Diversity section!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -146,7 +147,7 @@ export class DiversityCommand extends Subcommand {
|
||||
|
||||
await interaction.reply({
|
||||
content: `${!open ? 'Opened' : 'Closed'} this channel.`,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
@ -163,8 +164,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (user === null || guild === null || mod === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -177,8 +178,8 @@ export class DiversityCommand extends Subcommand {
|
||||
if (guildMember === undefined || diversity === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -190,7 +191,7 @@ export class DiversityCommand extends Subcommand {
|
||||
await this.threadManager(guildMember.id, false);
|
||||
await interaction.reply({
|
||||
content: `Removed the ${diversity.name} role from ${user}`,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -199,7 +200,7 @@ export class DiversityCommand extends Subcommand {
|
||||
await this.threadManager(guildMember.id, true);
|
||||
await interaction.reply({
|
||||
content: `Gave ${user} the ${diversity.name} role!`,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
await user
|
||||
.send(`You have been given the ${diversity.name} role by ${mod}!`)
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { Message, MessageFlagsBitField } from 'discord.js';
|
||||
import { ChannelType } from 'discord.js';
|
||||
|
||||
export class MoveAllCommand extends Command {
|
||||
@ -61,7 +61,9 @@ export class MoveAllCommand extends Command {
|
||||
const { member } = interaction;
|
||||
const { guild } = interaction;
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
if (
|
||||
channel.type !== ChannelType.GuildVoice &&
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { GuildMember, Message } from 'discord.js';
|
||||
import { GuildMember, Message, MessageFlagsBitField } from 'discord.js';
|
||||
|
||||
export class RenameUserCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
@ -68,8 +68,8 @@ export class RenameUserCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -81,8 +81,8 @@ export class RenameUserCommand extends Command {
|
||||
if (member === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -93,15 +93,15 @@ export class RenameUserCommand extends Command {
|
||||
} catch {
|
||||
await interaction.reply({
|
||||
content: "Bot doesn't have permission to change the user's name!",
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
await interaction.reply({
|
||||
content: `Changed ${user}'s nickname`,
|
||||
fetchReply: true,
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ import {
|
||||
import {
|
||||
ChannelType,
|
||||
EmbedBuilder,
|
||||
MessageFlagsBitField,
|
||||
PermissionsBitField,
|
||||
time,
|
||||
} from 'discord.js';
|
||||
@ -55,7 +56,7 @@ export async function restrictRun(
|
||||
let user = guild.client.users.cache.get(userId);
|
||||
|
||||
if (user === undefined) {
|
||||
user = await guild.client.users.fetch(userId);
|
||||
user = await guild.client.users.fetch(userId).catch(() => undefined);
|
||||
if (user === undefined) {
|
||||
info.message = 'Error fetching user';
|
||||
return info;
|
||||
@ -242,21 +243,31 @@ export async function restrictRun(
|
||||
await user.send({ embeds: [dmEmbed] }).catch(() => {});
|
||||
|
||||
// Log the ban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(IDs.channels.logs.restricted)) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
if (logChannel === undefined) {
|
||||
container.logger.error('Restrict Error: Could not fetch log channel');
|
||||
const fetchLogChannel = await guild.channels.fetch(
|
||||
IDs.channels.logs.restricted,
|
||||
);
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
container.logger.error('Restrict: Could not fetch log channel');
|
||||
info.message = `Restricted ${user} but could not find the log channel. This has been logged to the database.`;
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
container.logger.error(
|
||||
'Restrict: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message = `${user} has been restricted. This hasn't been logged in a text channel as the bot does not have permission to send logs!`;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const message = new EmbedBuilder()
|
||||
.setColor('#FF6700')
|
||||
.setAuthor({
|
||||
@ -324,15 +335,17 @@ export class RestrictCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await restrictRun(user?.id, mod.id, reason, guild);
|
||||
const info = await restrictRun(user.id, mod.id, reason, guild);
|
||||
|
||||
await interaction.editReply({
|
||||
content: info.message,
|
||||
@ -367,7 +380,7 @@ export class RestrictCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
const info = await restrictRun(user?.id, mod.id, reason, guild);
|
||||
const info = await restrictRun(user.id, mod.id, reason, guild);
|
||||
|
||||
await message.reply(info.message);
|
||||
await message.react(info.success ? '✅' : '❌');
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType, EmbedBuilder } from 'discord.js';
|
||||
import { ChannelType, EmbedBuilder, MessageFlagsBitField } from 'discord.js';
|
||||
import type { Message, TextChannel, Guild, Snowflake } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { getRestrictions } from '#utils/database/moderation/restriction';
|
||||
@ -63,8 +63,8 @@ export class RestrictLogsCommand extends Command {
|
||||
if (guild === null || channel === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild or channel!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -86,7 +86,6 @@ export class RestrictLogsCommand extends Command {
|
||||
// Checks if the channel topic has the user's snowflake
|
||||
if (channel.topic !== null) {
|
||||
topic = channel.topic.split(' ');
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
userId = topic[2];
|
||||
}
|
||||
}
|
||||
@ -95,8 +94,8 @@ export class RestrictLogsCommand extends Command {
|
||||
if (userId === null) {
|
||||
await interaction.reply({
|
||||
content: 'User could not be found or was not provided!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -106,8 +105,8 @@ export class RestrictLogsCommand extends Command {
|
||||
await interaction.reply({
|
||||
embeds: info.embeds,
|
||||
content: info.message,
|
||||
fetchReply: true,
|
||||
ephemeral: !staffChannel,
|
||||
withResponse: true,
|
||||
flags: staffChannel ? undefined : MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -176,7 +175,7 @@ export class RestrictLogsCommand extends Command {
|
||||
let user = guild.client.users.cache.get(userId);
|
||||
|
||||
if (user === undefined) {
|
||||
user = await guild.client.users.fetch(userId);
|
||||
user = await guild.client.users.fetch(userId).catch(() => undefined);
|
||||
if (user === undefined) {
|
||||
info.message = 'Error fetching user';
|
||||
return info;
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Message } from 'discord.js';
|
||||
import { User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import { restrictRun } from './restrict';
|
||||
|
||||
export class RestrictToleranceCommand extends Command {
|
||||
@ -69,15 +69,17 @@ export class RestrictToleranceCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await restrictRun(user?.id, mod.id, reason, guild, true);
|
||||
const info = await restrictRun(user.id, mod.id, reason, guild, true);
|
||||
|
||||
await interaction.editReply({
|
||||
content: info.message,
|
||||
@ -112,7 +114,7 @@ export class RestrictToleranceCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
const info = await restrictRun(user?.id, mod.id, reason, guild, true);
|
||||
const info = await restrictRun(user.id, mod.id, reason, guild, true);
|
||||
|
||||
await message.reply(info.message);
|
||||
await message.react(info.success ? '✅' : '❌');
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import { RegisterBehavior } from '@sapphire/framework';
|
||||
import { Subcommand } from '@sapphire/plugin-subcommands';
|
||||
import type { TextChannel } from 'discord.js';
|
||||
import { MessageFlagsBitField, TextChannel } from 'discord.js';
|
||||
import { CategoryChannel, ChannelType } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
@ -78,7 +78,9 @@ export class RestrictToolsCommand extends Subcommand {
|
||||
const user = interaction.options.getUser('user');
|
||||
const { guild, channel } = interaction;
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (guild === null || channel === null) {
|
||||
@ -142,11 +144,9 @@ export class RestrictToolsCommand extends Subcommand {
|
||||
return;
|
||||
}
|
||||
|
||||
const category = guild.channels.cache.get(IDs.categories.restricted) as
|
||||
| CategoryChannel
|
||||
| undefined;
|
||||
const category = guild.channels.cache.get(IDs.categories.restricted);
|
||||
|
||||
if (category === undefined) {
|
||||
if (!(category instanceof CategoryChannel)) {
|
||||
await interaction.editReply({
|
||||
content: 'Could not find category!',
|
||||
});
|
||||
@ -156,23 +156,45 @@ export class RestrictToolsCommand extends Subcommand {
|
||||
const textChannels = category.children.cache.filter(
|
||||
(c) => c.type === ChannelType.GuildText,
|
||||
);
|
||||
textChannels.forEach((c) => {
|
||||
const textChannel = c as TextChannel;
|
||||
|
||||
for (const channel of textChannels) {
|
||||
const textChannel = channel[1];
|
||||
|
||||
// Checks that the channel is a text channel
|
||||
if (!(textChannel instanceof TextChannel)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Checks that the channel has a topic
|
||||
if (textChannel.topic === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Checks if the channel topic has the user's snowflake
|
||||
if (textChannel.topic?.includes(user?.id)) {
|
||||
if (textChannel.topic.includes(user.id)) {
|
||||
topic = textChannel.topic.split(' ');
|
||||
const vcId = topic[topic.indexOf(user?.id) + 1];
|
||||
const voiceChannel = guild.channels.cache.get(vcId);
|
||||
const vcId = topic[topic.indexOf(user.id) + 1];
|
||||
let voiceChannel = guild.channels.cache.get(vcId);
|
||||
|
||||
if (voiceChannel === undefined) {
|
||||
const fetchVoiceChannel = await guild.channels
|
||||
.fetch(vcId)
|
||||
.catch(() => undefined);
|
||||
|
||||
if (fetchVoiceChannel !== null && fetchVoiceChannel !== undefined) {
|
||||
voiceChannel = fetchVoiceChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
voiceChannel !== undefined &&
|
||||
voiceChannel.parentId === IDs.categories.restricted
|
||||
) {
|
||||
voiceChannel.delete();
|
||||
await voiceChannel.delete();
|
||||
}
|
||||
await textChannel.delete();
|
||||
}
|
||||
textChannel.delete();
|
||||
}
|
||||
});
|
||||
|
||||
await interaction.editReply({
|
||||
content: `Successfully deleted the channel for ${user}`,
|
||||
|
@ -18,13 +18,19 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { CategoryChannel, ChannelType, EmbedBuilder } from 'discord.js';
|
||||
import type { User, Message, TextChannel, Guild, Snowflake } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { fetchRoles, addExistingUser } from '#utils/database/dbExistingUser';
|
||||
import type { Guild, Message, Snowflake, User } from 'discord.js';
|
||||
import {
|
||||
CategoryChannel,
|
||||
ChannelType,
|
||||
EmbedBuilder,
|
||||
MessageFlagsBitField,
|
||||
TextChannel,
|
||||
} from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { addExistingUser, fetchRoles } from '#utils/database/dbExistingUser';
|
||||
import {
|
||||
unRestrict,
|
||||
checkActive,
|
||||
unRestrict,
|
||||
unRestrictLegacy,
|
||||
} from '#utils/database/moderation/restriction';
|
||||
|
||||
@ -69,14 +75,14 @@ export class UnRestrictCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
const info = await this.unRestrictRun(user?.id, mod.id, guild);
|
||||
const info = await this.unRestrictRun(user.id, mod.id, guild);
|
||||
|
||||
await interaction.editReply({
|
||||
content: info.message,
|
||||
@ -108,7 +114,7 @@ export class UnRestrictCommand extends Command {
|
||||
const channelRun = message.channel;
|
||||
|
||||
const info = await this.unRestrictRun(
|
||||
user?.id,
|
||||
user.id,
|
||||
mod.id,
|
||||
guild,
|
||||
channelRun.id,
|
||||
@ -135,7 +141,8 @@ export class UnRestrictCommand extends Command {
|
||||
let user = guild.client.users.cache.get(userId);
|
||||
|
||||
if (user === undefined) {
|
||||
user = await guild.client.users.fetch(userId);
|
||||
user = await guild.client.users.fetch(userId).catch(() => undefined);
|
||||
|
||||
if (user === undefined) {
|
||||
info.message = 'Error fetching user';
|
||||
return info;
|
||||
@ -159,12 +166,13 @@ export class UnRestrictCommand extends Command {
|
||||
|
||||
if (member === undefined) {
|
||||
member = await guild.members.fetch(userId).catch(() => undefined);
|
||||
}
|
||||
|
||||
if (member === undefined) {
|
||||
info.message = "Can't unrestrict the user as they are not on this server";
|
||||
info.message =
|
||||
"Can't unrestrict the user as they are not on this server";
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user is in database
|
||||
await addExistingUser(member);
|
||||
@ -180,16 +188,20 @@ export class UnRestrictCommand extends Command {
|
||||
if (await checkActive(userId)) {
|
||||
const roles = await fetchRoles(userId);
|
||||
await member.roles.add(roles);
|
||||
|
||||
// Unrestricts the user on the database
|
||||
await unRestrict(userId, modId);
|
||||
} else {
|
||||
let section = 1;
|
||||
|
||||
for (let i = 0; i < restrictRoles.length; i += 1) {
|
||||
if (member.roles.cache.has(restrictRoles[i])) {
|
||||
section = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
await member.roles.add(IDs.roles.nonvegan.nonvegan);
|
||||
|
||||
// Unrestricts the user on the database but for restricts done on the old bot
|
||||
await unRestrictLegacy(userId, modId, section);
|
||||
}
|
||||
@ -198,59 +210,94 @@ export class UnRestrictCommand extends Command {
|
||||
|
||||
// Remove vegan restrict channels
|
||||
if (member.roles.cache.has(IDs.roles.vegan.vegan)) {
|
||||
const category = guild.channels.cache.get(IDs.categories.restricted) as
|
||||
| CategoryChannel
|
||||
| undefined;
|
||||
const category = guild.channels.cache.get(IDs.categories.restricted);
|
||||
|
||||
if (!(category instanceof CategoryChannel)) {
|
||||
info.message =
|
||||
'Could not find the restricted category! The channels will have to be deleted manually.';
|
||||
return info;
|
||||
}
|
||||
|
||||
let topic: string[];
|
||||
|
||||
if (category !== undefined) {
|
||||
const textChannels = category.children.cache.filter(
|
||||
(c) => c.type === ChannelType.GuildText,
|
||||
);
|
||||
textChannels.forEach((c) => {
|
||||
const textChannel = c as TextChannel;
|
||||
|
||||
for (const channel of textChannels) {
|
||||
const textChannel = channel[1];
|
||||
|
||||
// Checks that the channel is a text channel
|
||||
if (!(textChannel instanceof TextChannel)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Checks that the channel has a topic
|
||||
if (textChannel.topic === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Checks if the channel topic has the user's snowflake
|
||||
if (textChannel.topic?.includes(userId)) {
|
||||
if (textChannel.topic.includes(userId)) {
|
||||
if (textChannel.id === channelRun) {
|
||||
info.runInVeganRestrict = true;
|
||||
}
|
||||
|
||||
topic = textChannel.topic.split(' ');
|
||||
const vcId = topic[topic.indexOf(userId) + 1];
|
||||
const voiceChannel = guild.channels.cache.get(vcId);
|
||||
const vcId = topic[topic.indexOf(user.id) + 1];
|
||||
let voiceChannel = guild.channels.cache.get(vcId);
|
||||
|
||||
if (voiceChannel === undefined) {
|
||||
const fetchVoiceChannel = await guild.channels
|
||||
.fetch(vcId)
|
||||
.catch(() => undefined);
|
||||
|
||||
if (fetchVoiceChannel !== null && fetchVoiceChannel !== undefined) {
|
||||
voiceChannel = fetchVoiceChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
voiceChannel !== undefined &&
|
||||
// Used for sanitising the channel topic, so another voice channel does not get deleted
|
||||
voiceChannel.parentId === IDs.categories.restricted
|
||||
) {
|
||||
voiceChannel.delete();
|
||||
await voiceChannel.delete();
|
||||
}
|
||||
textChannel.delete();
|
||||
|
||||
await textChannel.delete();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
info.success = true;
|
||||
|
||||
// Log the ban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.restricted);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(
|
||||
const fetchLogChannel = await guild.channels.fetch(
|
||||
IDs.channels.logs.restricted,
|
||||
)) as TextChannel | undefined;
|
||||
if (logChannel === undefined) {
|
||||
this.container.logger.error(
|
||||
'Restrict Error: Could not fetch log channel',
|
||||
);
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Unrestrict: Could not fetch log channel');
|
||||
info.message = `Unrestricted ${user} but could not find the log channel. This has been logged to the database.`;
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Unrestrict: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message = `Unrestricted ${user} but could not find the log channel. This hasn't been logged in a text channel as the bot does not have permission to send logs!`;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const message = new EmbedBuilder()
|
||||
.setColor('#28A745')
|
||||
.setAuthor({
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message, TextBasedChannel } from 'discord.js';
|
||||
import { Message, MessageFlagsBitField, TextBasedChannel } from 'discord.js';
|
||||
import { ChannelType } from 'discord.js';
|
||||
import { Duration, DurationFormatter } from '@sapphire/time-utilities';
|
||||
import { isNumber } from '#utils/maths';
|
||||
@ -61,8 +61,8 @@ export class SlowmodeCommand extends Command {
|
||||
if (channel === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not fetch channel!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { GuildMember, Message } from 'discord.js';
|
||||
import { GuildMember, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class SoftMuteCommand extends Command {
|
||||
@ -64,8 +64,8 @@ export class SoftMuteCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching the guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -77,8 +77,8 @@ export class SoftMuteCommand extends Command {
|
||||
if (guildMember === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -87,7 +87,7 @@ export class SoftMuteCommand extends Command {
|
||||
await guildMember.roles.remove(IDs.roles.restrictions.softMute);
|
||||
await interaction.reply({
|
||||
content: `Removed soft muted for ${user}`,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -96,7 +96,7 @@ export class SoftMuteCommand extends Command {
|
||||
|
||||
await interaction.reply({
|
||||
content: `Soft muted ${user}`,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { GuildMember, Message } from 'discord.js';
|
||||
import { GuildMember, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import {
|
||||
addMute,
|
||||
removeMute,
|
||||
@ -73,8 +73,8 @@ export class VCMuteCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -87,8 +87,8 @@ export class VCMuteCommand extends Command {
|
||||
if (member === undefined || mod === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -102,8 +102,8 @@ export class VCMuteCommand extends Command {
|
||||
|
||||
await interaction.reply({
|
||||
content: `Removed server mute from ${user}`,
|
||||
fetchReply: true,
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -118,8 +118,8 @@ export class VCMuteCommand extends Command {
|
||||
await addMute(member.id, mod.id, reason);
|
||||
await interaction.reply({
|
||||
content: `Server muted ${user}`,
|
||||
fetchReply: true,
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import { EmbedBuilder, MessageFlagsBitField } from 'discord.js';
|
||||
import type { Message, Guild, User } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import {
|
||||
@ -68,15 +68,17 @@ export class DeleteWarningCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const staffChannel = checkStaff(interaction.channel);
|
||||
|
||||
await interaction.deferReply({ ephemeral: !staffChannel });
|
||||
await interaction.deferReply({
|
||||
flags: staffChannel ? undefined : MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.deleteWarning(warningId, mod, guild);
|
||||
|
||||
@ -145,25 +147,37 @@ export class DeleteWarningCommand extends Command {
|
||||
}
|
||||
|
||||
// Log the warnings deletion
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(IDs.channels.logs.sus)) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
if (logChannel === undefined) {
|
||||
const fetchLogChannel = await guild.channels
|
||||
.fetch(IDs.channels.logs.sus)
|
||||
.catch(() => undefined);
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error(
|
||||
'Delete Warning Error: Could not fetch log channel',
|
||||
'Delete Warning: Could not fetch log channel',
|
||||
);
|
||||
info.message =
|
||||
`Deleted warning for ${user} (Warning ID: ${warningId} but ` +
|
||||
'could not find the log channel.';
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Delete Warning: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message =
|
||||
`Deleted warning for ${user} (Warning ID: ${warningId} but ` +
|
||||
"But this hasn't been logged in a text channel as the bot does not have permission to send logs!";
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const message = new EmbedBuilder()
|
||||
.setColor('#28A745')
|
||||
.setAuthor({
|
||||
|
@ -17,16 +17,17 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import {
|
||||
Args,
|
||||
Command,
|
||||
container,
|
||||
RegisterBehavior,
|
||||
} from '@sapphire/framework';
|
||||
import type { User, Message, Snowflake, Guild, TextChannel } from 'discord.js';
|
||||
EmbedBuilder,
|
||||
Guild,
|
||||
Message,
|
||||
MessageFlagsBitField,
|
||||
Snowflake,
|
||||
User,
|
||||
} from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { addWarn } from '#utils/database/moderation/warnings';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class WarnCommand extends Command {
|
||||
@ -76,8 +77,8 @@ export class WarnCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -190,21 +191,32 @@ export class WarnCommand extends Command {
|
||||
await user.send({ embeds: [dmEmbed] }).catch(() => {});
|
||||
|
||||
// Log the ban
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus);
|
||||
|
||||
if (logChannel === undefined) {
|
||||
logChannel = (await guild.channels.fetch(IDs.channels.logs.sus)) as
|
||||
| TextChannel
|
||||
| undefined;
|
||||
if (logChannel === undefined) {
|
||||
container.logger.error('Warn Error: Could not fetch log channel');
|
||||
const fetchLogChannel = await guild.channels
|
||||
.fetch(IDs.channels.logs.sus)
|
||||
.catch(() => undefined);
|
||||
|
||||
if (fetchLogChannel === null || fetchLogChannel === undefined) {
|
||||
this.container.logger.error('Warn: Could not fetch log channel');
|
||||
info.message = `Warned ${user} but could not find the log channel. This has been logged to the database.`;
|
||||
|
||||
return info;
|
||||
} else {
|
||||
logChannel = fetchLogChannel;
|
||||
}
|
||||
}
|
||||
|
||||
if (!logChannel.isSendable()) {
|
||||
this.container.logger.error(
|
||||
'Warn: The bot does not have permission to send in the logs channel!',
|
||||
);
|
||||
info.message = `Warned ${user}, but the bot does not have permission to send in the logs channel!`;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
const message = new EmbedBuilder()
|
||||
.setColor('#FF6700')
|
||||
.setAuthor({
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType, EmbedBuilder } from 'discord.js';
|
||||
import { ChannelType, EmbedBuilder, MessageFlagsBitField } from 'discord.js';
|
||||
import type { Message, Guild, User } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { fetchWarnings } from '#utils/database/moderation/warnings';
|
||||
@ -65,15 +65,17 @@ export class WarningsCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const staffChannel = checkStaff(interaction.channel);
|
||||
|
||||
await interaction.deferReply({ ephemeral: !staffChannel });
|
||||
await interaction.deferReply({
|
||||
flags: staffChannel ? undefined : MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.warnings(user, guild);
|
||||
|
||||
|
@ -19,7 +19,12 @@
|
||||
|
||||
import { Subcommand } from '@sapphire/plugin-subcommands';
|
||||
import { RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType, PermissionsBitField, Snowflake } from 'discord.js';
|
||||
import {
|
||||
ChannelType,
|
||||
MessageFlagsBitField,
|
||||
PermissionsBitField,
|
||||
Snowflake,
|
||||
} from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import {
|
||||
addStatUser,
|
||||
@ -190,7 +195,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Mod or guild was not found!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -200,7 +205,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (mod === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Outreach Leader was not found!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -208,7 +213,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (!mod.roles.cache.has(IDs.roles.staff.outreachLeader)) {
|
||||
await interaction.reply({
|
||||
content: 'You need to be an Outreach Leader to run this command!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -216,7 +221,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (await checkActiveEvent()) {
|
||||
await interaction.reply({
|
||||
content: 'There is already an active event!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -227,7 +232,7 @@ export class OutreachCommand extends Subcommand {
|
||||
|
||||
await interaction.reply({
|
||||
content: 'Created the event!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
}
|
||||
|
||||
@ -238,7 +243,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Guild not found!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -248,7 +253,7 @@ export class OutreachCommand extends Subcommand {
|
||||
if (mod === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Your guild member was not found!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -256,12 +261,14 @@ export class OutreachCommand extends Subcommand {
|
||||
if (!mod.roles.cache.has(IDs.roles.staff.outreachLeader)) {
|
||||
await interaction.reply({
|
||||
content: 'You need to be an Outreach Leader to run this command!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const event = await getCurrentEvent();
|
||||
|
||||
@ -351,12 +358,14 @@ export class OutreachCommand extends Subcommand {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Guild not found!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
if ((await getStatFromLeader(leader.id)) !== null) {
|
||||
await interaction.editReply(
|
||||
@ -462,12 +471,14 @@ export class OutreachCommand extends Subcommand {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
let statId: number;
|
||||
let roleId: Snowflake | undefined;
|
||||
@ -571,12 +582,14 @@ export class OutreachCommand extends Subcommand {
|
||||
if (leader === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find your user!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const stat = await getStatFromLeader(leader.id);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class BookClubCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageBookClub(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class DebateHostCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageDebateHost(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class GameNightHostCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageGameNight(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class GuestCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageGuest(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class MentorCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageMentor(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class ModCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageMod(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class RestrictedAccessCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageRestrictedAccess(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class StageHostCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageStageHost(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class TrialModCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageMod(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class TrialVerifierCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageTrialVerifier(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -62,13 +62,15 @@ export class VerifierCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageVerifier(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -65,13 +65,15 @@ export class ActivistCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageActivist(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -64,13 +64,15 @@ export class ARAVeganCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageVegan(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class ConvincedCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageConvinced(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,7 +63,7 @@ export class PlusCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class TrustedCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageTrusted(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -65,13 +65,15 @@ export class VeganCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageVegan(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Guild, User, Message } from 'discord.js';
|
||||
import { Guild, User, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
|
||||
|
||||
@ -63,13 +63,15 @@ export class VegCuriousCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
const info = await this.manageVegCurious(user, mod, guild);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { Message, MessageFlagsBitField } from 'discord.js';
|
||||
|
||||
export class ApplyCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
@ -47,8 +47,8 @@ export class ApplyCommand extends Command {
|
||||
public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
|
||||
await interaction.reply({
|
||||
content: this.message,
|
||||
fetchReply: true,
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { Message, MessageFlagsBitField } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class RenameUserCommand extends Command {
|
||||
@ -47,22 +47,22 @@ export class RenameUserCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await guild.members.fetch();
|
||||
|
||||
const vegan = await guild.roles.cache.get(IDs.roles.vegan.vegan);
|
||||
const notVegan = await guild.roles.cache.get(IDs.roles.nonvegan.nonvegan);
|
||||
const vegan = guild.roles.cache.get(IDs.roles.vegan.vegan);
|
||||
const notVegan = guild.roles.cache.get(IDs.roles.nonvegan.nonvegan);
|
||||
|
||||
if (vegan === undefined || notVegan === undefined) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching roles!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -71,7 +71,7 @@ export class RenameUserCommand extends Command {
|
||||
content:
|
||||
`${vegan.name}s: \`${vegan.members.size}\`` +
|
||||
`\n${notVegan.name}s: \`${notVegan.members.size}\``,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
@ -88,8 +88,8 @@ export class RenameUserCommand extends Command {
|
||||
|
||||
await guild.members.fetch();
|
||||
|
||||
const vegan = await guild.roles.cache.get(IDs.roles.vegan.vegan);
|
||||
const notVegan = await guild.roles.cache.get(IDs.roles.nonvegan.nonvegan);
|
||||
const vegan = guild.roles.cache.get(IDs.roles.vegan.vegan);
|
||||
const notVegan = guild.roles.cache.get(IDs.roles.nonvegan.nonvegan);
|
||||
|
||||
if (vegan === undefined || notVegan === undefined) {
|
||||
await message.react('❌');
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import IDs from '#utils/ids';
|
||||
import { MessageFlagsBitField } from 'discord.js';
|
||||
|
||||
export class InfoCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
@ -66,11 +67,7 @@ export class InfoCommand extends Command {
|
||||
const option = interaction.options.getString('info', true);
|
||||
let ephemeral = interaction.options.getBoolean('visible');
|
||||
|
||||
if (ephemeral === null) {
|
||||
ephemeral = true;
|
||||
} else {
|
||||
ephemeral = !ephemeral;
|
||||
}
|
||||
ephemeral = ephemeral !== true;
|
||||
|
||||
let message: string;
|
||||
|
||||
@ -115,7 +112,7 @@ export class InfoCommand extends Command {
|
||||
|
||||
await interaction.reply({
|
||||
content: message,
|
||||
ephemeral,
|
||||
flags: ephemeral ? MessageFlagsBitField.Flags.Ephemeral : undefined,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,13 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { Message, User, Guild, Snowflake } from 'discord.js';
|
||||
import {
|
||||
Message,
|
||||
User,
|
||||
Guild,
|
||||
Snowflake,
|
||||
MessageFlagsBitField,
|
||||
} from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import {
|
||||
finishVerifyMessages,
|
||||
@ -77,8 +83,8 @@ export class VerifyCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -93,7 +99,7 @@ export class VerifyCommand extends Command {
|
||||
|
||||
await interaction.reply({
|
||||
content: verify.message,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import IDs from '#utils/ids';
|
||||
import { checkVerificationFinish } from '#utils/database/verification';
|
||||
import { MessageFlagsBitField } from 'discord.js';
|
||||
|
||||
export class VerifyTimeoutRemoveCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
@ -60,13 +61,15 @@ export class VerifyTimeoutRemoveCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching guild!',
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
withResponse: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
|
||||
let member = guild.members.cache.get(user.id);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { User, Guild, Message, MessageFlagsBitField } from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { getRank, xpToNextLevel } from '#utils/database/fun/xp';
|
||||
|
||||
@ -55,7 +55,7 @@ export class RankCommand extends Command {
|
||||
if (guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Could not find the guild!',
|
||||
ephemeral: true,
|
||||
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -134,11 +134,7 @@ export class FixRolesOnReady extends Listener {
|
||||
|
||||
if (
|
||||
restricted ||
|
||||
member.roles.cache.has(IDs.roles.restrictions.restricted1) ||
|
||||
member.roles.cache.has(IDs.roles.restrictions.restricted2) ||
|
||||
member.roles.cache.has(IDs.roles.restrictions.restricted3) ||
|
||||
member.roles.cache.has(IDs.roles.restrictions.restricted4) ||
|
||||
member.roles.cache.has(IDs.roles.restrictions.restrictedVegan)
|
||||
member.roles.cache.hasAny(...IDs.roles.restrictions.restricted)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user