Skip to main content

🔒 Closing a Ticket

Tickets can be closed by staff in two ways: via the ❌ reaction on the welcome message, or via the !ticket close command.


What happens when a ticket closes

1. Bot unregisters the ticket from the in-memory store
2. Archiver fetches all messages and renders an HTML transcript (if enabled)
3. Transcript saved to disk → transcript-archive/{filename}.html
4. Transcript DM'd to opener (if archive.dmOpener = true)
5. Transcript DM'd to log user (if ARCHIVE_LOG_USER_ID is set)
6. Bot posts a closing embed in the channel
7. Bot waits 3 seconds (grace period for members to read the notice)
8. Bot deletes the channel

Closing via reaction

Any user who can manage the channel (staff with the support role) can react with ❌ on the welcome message (the first message the bot posted when the ticket was opened).

The bot removes the reaction and begins the close flow.


Closing via command

Run the following inside the ticket channel:

!ticket close
note

This command only works inside a ticket channel. Running it in any other channel will return an error.


The closing embed

Before deleting the channel, the bot posts a brief notice:

🔒 Ticket Closed
This ticket was closed by @StaffMember.
The channel will be deleted in a moment.

Members have approximately 3 seconds to read this before the channel is gone.


Archiving on close

See Archiving & Transcripts for full details on the HTML transcript system and how to retrieve archived files.


Race condition protection

The bot unregisters the ticket before starting the archive/close flow. If someone tries to close the same ticket twice simultaneously, the second attempt will find no registered ticket and do nothing — preventing double-deletion errors.