So, I have multiple public variables, but if one has multiple tickets open, the variables are shared between tickets, since it is the same script, which breaks the program since variables need to be reset at ticket creation. I was thinking if I could use objects, but I haven't the faintest idea how to implement that. Here's my code: https://paste.myst.rs/dj7
Asked
Active
Viewed 908 times
0
-
You'd need, at the very least, a `Ticket` class, plus some sort of repository (could be as simple as a list or as complex as a relational database) to store the tickets in. I strongly suggest you brush up on your OOP basics. – Jul 26 '20 at 21:19
-
Ok thank you! I didn't think I would need a database, but you're right. My system creates a ticket transcript, so I can just send that into another discord channel. Anyways, thank you again! – GouramEats Jul 29 '20 at 01:55
-
If you "store" your tickets by writing them into a discord channel, then it is still sensible to have a repository class which handles saving and loading the tickets from there, and possibly caches them in-memory for increased performance. – Jul 29 '20 at 02:32