mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 17:04:15 +02:00
fix(arabot): new sus role was put in the wrong place
This commit is contained in:
parent
98b9ac6fde
commit
881f9bfc24
@ -157,10 +157,10 @@ export class SusCommand extends Subcommand {
|
|||||||
const { guild } = interaction;
|
const { guild } = interaction;
|
||||||
|
|
||||||
// Checks if all the variables are of the right type
|
// Checks if all the variables are of the right type
|
||||||
if (!(guild instanceof Guild)) {
|
if (guild === null) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching guild!',
|
content: 'Error fetching guild!',
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ export class SusCommand extends Subcommand {
|
|||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: info.message,
|
content: info.message,
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ export class SusCommand extends Subcommand {
|
|||||||
|
|
||||||
const guild = message.guild;
|
const guild = message.guild;
|
||||||
|
|
||||||
if (!(guild instanceof Guild)) {
|
if (guild === null) {
|
||||||
await message.react('❌');
|
await message.react('❌');
|
||||||
await message.reply(
|
await message.reply(
|
||||||
'Could not find guild! Make sure you run this command in a server.',
|
'Could not find guild! Make sure you run this command in a server.',
|
||||||
@ -292,7 +292,7 @@ export class SusCommand extends Subcommand {
|
|||||||
if (guild == null) {
|
if (guild == null) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching guild!',
|
content: 'Error fetching guild!',
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -306,8 +306,8 @@ export class SusCommand extends Subcommand {
|
|||||||
if (notes.length === 0) {
|
if (notes.length === 0) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `${user} has no sus notes!`,
|
content: `${user} has no sus notes!`,
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
fetchReply: true,
|
withResponse: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -318,8 +318,8 @@ export class SusCommand extends Subcommand {
|
|||||||
// Sends the notes to the user
|
// Sends the notes to the user
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [noteEmbed],
|
embeds: [noteEmbed],
|
||||||
ephemeral: !staffChannel,
|
flags: staffChannel ? undefined : MessageFlagsBitField.Flags.Ephemeral,
|
||||||
fetchReply: true,
|
withResponse: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,8 +333,8 @@ export class SusCommand extends Subcommand {
|
|||||||
if (guild === null || channel === null) {
|
if (guild === null || channel === null) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching guild or channel!',
|
content: 'Error fetching guild or channel!',
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
fetchReply: true,
|
withResponse: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -346,8 +346,8 @@ export class SusCommand extends Subcommand {
|
|||||||
if (note === null) {
|
if (note === null) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching note from database!',
|
content: 'Error fetching note from database!',
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
fetchReply: true,
|
withResponse: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -363,8 +363,8 @@ export class SusCommand extends Subcommand {
|
|||||||
if (user === undefined) {
|
if (user === undefined) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching user!',
|
content: 'Error fetching user!',
|
||||||
ephemeral: true,
|
flags: MessageFlagsBitField.Flags.Ephemeral,
|
||||||
fetchReply: true,
|
withResponse: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -475,10 +475,10 @@ export class SusCommand extends Subcommand {
|
|||||||
) {
|
) {
|
||||||
// Find user
|
// Find user
|
||||||
let user = guild.client.users.cache.get(userId);
|
let user = guild.client.users.cache.get(userId);
|
||||||
if (!(user instanceof User)) {
|
if (user === undefined) {
|
||||||
user = await guild.client.users.fetch(userId).catch(() => undefined);
|
user = await guild.client.users.fetch(userId).catch(() => undefined);
|
||||||
}
|
}
|
||||||
if (!(user instanceof User)) return;
|
if (user === undefined) return;
|
||||||
|
|
||||||
// Log the sus note
|
// Log the sus note
|
||||||
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus) as
|
let logChannel = guild.channels.cache.get(IDs.channels.logs.sus) as
|
||||||
|
Loading…
x
Reference in New Issue
Block a user