mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-04 01:11:27 +03:00
fix: known error handling (permissions and unknown roles)
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user