generated from Baipyrus/DiscordJS-Template
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
|
// Fetch role from guild
|
||||||
const guild = reaction.message.guild;
|
const guild = reaction.message.guild;
|
||||||
const role = await guild.roles.fetch(rep.role);
|
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 {
|
try {
|
||||||
// Add role to user
|
// Add role to user
|
||||||
|
@ -31,7 +31,11 @@ export async function execute(reaction, user) {
|
|||||||
// Fetch role from guild
|
// Fetch role from guild
|
||||||
const guild = reaction.message.guild;
|
const guild = reaction.message.guild;
|
||||||
const role = await guild.roles.fetch(rep.role);
|
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 {
|
try {
|
||||||
// Remove role from user
|
// Remove role from user
|
||||||
|
Loading…
Reference in New Issue
Block a user