mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 10:34:16 +02:00
refactor(arabot): remove forcing types as its unnecessary
This commit is contained in:
parent
ecd5a692c1
commit
ac50b96ba8
@ -63,11 +63,11 @@ class StageHostCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gets guildMember whilst removing the ability of each other variables being null
|
// Gets guildMember whilst removing the ability of each other variables being null
|
||||||
let guildMember = guild!.members.cache.get(user!.id);
|
const guildMember = guild.members.cache.get(user.id);
|
||||||
let stageHost = guild!.roles.cache.get(IDs.roles.stageHost);
|
const stageHost = guild.roles.cache.get(IDs.roles.stageHost);
|
||||||
|
|
||||||
// Checks if guildMember is null
|
// Checks if guildMember is null
|
||||||
if (guildMember === null || stageHost === undefined) {
|
if (guildMember === undefined || stageHost === undefined) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Error fetching user!',
|
content: 'Error fetching user!',
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
@ -76,24 +76,20 @@ class StageHostCommand extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes the possibility of guildMember being null
|
// Checks if the user has Stage Host and to give them or remove them based on if they have it
|
||||||
guildMember = guildMember!;
|
|
||||||
stageHost = stageHost!;
|
|
||||||
|
|
||||||
// Checks if the user has Veg Curious and to give them or remove them based on if they have it
|
|
||||||
if (guildMember.roles.cache.has(IDs.roles.stageHost)) {
|
if (guildMember.roles.cache.has(IDs.roles.stageHost)) {
|
||||||
// Remove the Veg Curious role from the user
|
// Remove the Veg Curious role from the user
|
||||||
await guildMember.roles.remove(stageHost);
|
await guildMember.roles.remove(stageHost);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Removed the ${stageHost.name} role from ${user!}`,
|
content: `Removed the ${stageHost.name} role from ${user}`,
|
||||||
fetchReply: true,
|
fetchReply: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Add Veg Curious role to the user
|
// Give Stage Host role to the user
|
||||||
await guildMember.roles.add(stageHost);
|
await guildMember.roles.add(stageHost);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Gave ${user!} the ${stageHost.name} role!`,
|
content: `Gave ${user} the ${stageHost.name} role!`,
|
||||||
fetchReply: true,
|
fetchReply: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user