discord-tickets / bot

The most popular open-source and self-hosted ticket management bot for Discord - a free alternative to the premium and white-label plans of other popular ticketing bots.
https://discordtickets.app
GNU General Public License v3.0
880 stars 459 forks source link

[BUG] Moving a ticket into a newly created category results in an error #531

Open nielslangerak opened 4 months ago

nielslangerak commented 4 months ago

Is there an existing issue for this?

Current Behavior

Right now when I move a ticket, I get the following error message: image

In the logs I see

24/03/24 22:53:18 [ERROR] (COMMANDS) f6600aede1
24/03/24 22:53:18 [ERROR] (COMMANDS) "move" command execution error: TypeError: Cannot read properties of undefined (reading 'total') at MoveSlashCommand.run (/home/container/src/commands/slash/move.js:109:4)

Expected Behavior

It should move the ticket to the right category without any errors

Steps To Reproduce

  1. Open a ticket
  2. Move the ticket
  3. You get the error

Environment

- OS: Ubuntu 22.04
- Node: 18.19.0
- NPM: 'Unkown command: "npm"' - So I guess none
- Bot: 4.0.13

Anything else?

No response

eartharoid commented 4 months ago

@nielslangerak This happens when you have just created a category. You can either

  1. restart or resync (type sync in the bot's console)
  2. create a ticket in the new category before moving the existing ticket
nielslangerak commented 4 months ago

The restart did it!

eartharoid commented 4 months ago

Reopening because it should be straightforward to make this somewhat common use work without error.