mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-04 01:11:27 +03:00
feat: block timed out users (#612)
Don't let timed out users open tickets. Letting them open tickets is useless as they won't be able to write anything inside. This reduces potential spam from misbehaving users.
This commit is contained in:
@@ -226,6 +226,11 @@ module.exports = class TicketManager {
|
||||
if (blocked) return await sendError('blocked');
|
||||
}
|
||||
|
||||
// Don't let timed out users open tickets, they won't be able to write anything inside
|
||||
if (member.isCommunicationDisabled()) {
|
||||
return await sendError('blocked');
|
||||
}
|
||||
|
||||
if (category.requiredRoles.length !== 0) {
|
||||
const missing = category.requiredRoles.some(r => !member.roles.cache.has(r));
|
||||
if (missing) return await sendError('missing_roles');
|
||||
|
Reference in New Issue
Block a user