reaction event error feedback
This commit is contained in:
parent
474a35a736
commit
c66cff1d21
@ -35,7 +35,11 @@ export async function execute(reaction, user) {
|
||||
// Fetch role from guild
|
||||
const guild = reaction.message.guild;
|
||||
const role = await guild.roles.fetch(rep.role);
|
||||
if (role === null) return;
|
||||
// Role not found
|
||||
if (role === null) {
|
||||
await user.send('Could not fetch role! Please contact server staff.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Add role to user
|
||||
|
@ -31,7 +31,11 @@ export async function execute(reaction, user) {
|
||||
// Fetch role from guild
|
||||
const guild = reaction.message.guild;
|
||||
const role = await guild.roles.fetch(rep.role);
|
||||
if (role === null) return;
|
||||
// Role not found
|
||||
if (role === null) {
|
||||
await user.send('Could not fetch role! Please contact server staff.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Remove role from user
|
||||
|
Loading…
Reference in New Issue
Block a user