bot icon indicating copy to clipboard operation
bot copied to clipboard

[BUG] Manual deletion of channel prevents tickets from closing.

Open missionz3r0 opened this issue 2 years ago • 2 comments

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

  1. Create new category
  2. Create new button panel for created category
  3. Create a ticket using the button panel.
  4. Delete the created channel.
  5. 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 image

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)

missionz3r0 avatar Mar 11 '22 00:03 missionz3r0

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.

n1kkl avatar Jun 24 '22 10:06 n1kkl

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

RooRay avatar Jun 26 '22 22:06 RooRay