bot
bot copied to clipboard
[BUG] Manual deletion of channel prevents tickets from closing.
Describe the bug
If someone manually deletes a ticket's channel, you can not close the ticket associated with that channel. This leaves the user unable to create a new ticket since they can't close their old one.
Additionally, it requires DB writes and a server restart to clear out the the ticket.
To reproduce
- Create new category
- Create new button panel for created category
- Create a ticket using the button panel.
- Delete the created channel.
- Attempt to close ticket. Either time, or by id. Doesn't matter.
Expected behaviour The ticket is able to be closed despite the state of discord. If a channel or category doesn't exist anymore, the ticket should still close.
Screenshots
Additional Context
10.03 19:10:18 [Bot] 2022-03-11 00:10:18 [INFO] (COMMANDS) Executing "close" command (invoked by missionz3r0#____)
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [NOTICE] PLEASE INCLUDE THIS INFORMATION IF YOU ASK FOR HELP ABOUT THE FOLLOWING ERROR:
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [NOTICE] Discord Tickets v3.1.2, Node v16.7.0 on linux
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [] An error was not caught
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [] Uncaught Error
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [ERROR] Error: A ticket with the ID or number "951633061571866634" could not be resolved
10.03 19:10:21 [Bot] at TicketManager.close (/src/modules/tickets/manager.js:231:21)
10.03 19:10:21 [Bot] at runMicrotasks (<anonymous>)
10.03 19:10:21 [Bot] at processTicksAndRejections (node:internal/process/task_queues:96:5)
10.03 19:10:21 [Bot] at async InteractionCollector.<anonymous> (/src/commands/close.js:275:6)
I think it'd make more sense to just close the ticket if the channel is deleted. There is no point in having a ticket without channel.
I think it'd make more sense to just close the ticket if the channel is deleted. There is no point in having a ticket without channel.
this, unless the bot makes a new channel when it detects the channel is deleted but just deleting the ticket would likely be more practical
edit: apparently I forgot how githubs reply system works