mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-02-23 10:51:22 +02:00
fix: known error handling (permissions and unknown roles)
This commit is contained in:
parent
ea6e5d3f55
commit
cc5c0b028b
@ -46,7 +46,7 @@ module.exports.handleInteractionError = async event => {
|
||||
embeds: [],
|
||||
};
|
||||
|
||||
if (/Supplied parameter is not a User nor a Role/.test(error.message)) {
|
||||
if (error.code === 10011 || (error.code === 'Invalid Type' && /Role/.test(error.message))) {
|
||||
data.embeds.push(
|
||||
new EmbedBuilder()
|
||||
.setColor('Orange')
|
||||
@ -59,7 +59,7 @@ module.exports.handleInteractionError = async event => {
|
||||
},
|
||||
]),
|
||||
);
|
||||
} else if (/Missing Permissions/.test(error.message)) {
|
||||
} else if (/Missing (Access|Permissions)/.test(error.message)) {
|
||||
data.embeds.push(
|
||||
new EmbedBuilder()
|
||||
.setColor('Orange')
|
||||
|
Loading…
x
Reference in New Issue
Block a user