Raffles not persistent between sessions


I have been running a ticket raffle this week and just had to restart the computer for a security update. When the bot came back online users attempting to enter the raffle were met with the message “There is no ticket raffle opened.”

Starting the ticket raffle back up cleared all users. What makes this worse is I have no way of knowing all the users that had entered, and the number of tickets they had purchased. So I can’t refund users what they spent. And there is no manual user input so even if I had a list of users that were in the raffle I could not manually add them back in. This has put me in a really rough spot.


This isn’t a bug, it’s intentional:


While I understand that this is as designed, I would like to see this addressed to match both user expectations and needs.

Right now a user can start a raffle, and end a raffle. As there are no stated restriction on those actions, users will expect that it is up to their digression when the raffle is ended. Right now a raffle could be terminated by a system reboot, software update, crash, etc. which loses all data in a way that it can not be recovered, and does not meet user expectations of having control over when a raffle is ended.

It is common place for raffles to last for multiple days, or a full week, especially for larger or higher value giveaways. This is something I observe on a regular basis on Twitch, especially in the creative category when big giveaways happen. By running the raffle over a longer period you are able to insure a larger percentage of your audience is able to participate.

Rather than storing entries and raffle state in memory (introducing a session based limitation) they could be stored in the database. To that point, this might be a good opportunity to investigate what other areas of the bot are storing information in memory to see if there is other functionality that could benefit from taking advantage of the database.

My main concern here is that whenever I run into an issue like this my users start sending me private messages and whispers like “Raffles don’t have this problem on AnkhBot” or “Try the new giveaway feature on Stream Elements” (both of those were proposed to me multiple times in this case). I wholeheartedly believe that Phantombot is the better over-all solution and stand by my choice to commit to it as our only bot. It’s just concerning to me when Phantombot does not have functional functional parity with its peers, as I feel it should be ahead of the curve. With recent developments (AnkhBot joining Streamlabs, and StreamElements adoption rate increasing and their focus on pushing their own bot) now is the time to insure Phantobot has a strong foothold. It is for that reason that I’m trying to thoroughly report things that I see as needing to be addressed and do my part to help where I can. I really do believe Phantobot is the superior bot with the most potential.

I’d also like to put my money where my mouth is, but I can’t seem to find the donate option on the phantombot.tv site. I seem to remember seeing that option in the past. Has it been removed?

Thanks again for the quick responses.



So, you could just keep the bot running and you won’t have this issue (just saying). I’ve personally moved my bots over to free AWS servers for this reason.

I’m kind of confused by your logic here, because in all honesty, a computer crash could result in the loss of more data than just memory.

I’m repeating myself here, but it’s also common practice for a bot to be running 24/7 minus downtime for updates and network issues. And the beauty of phantombot is that if you don’t like something in it, you can change it (since everything is open source). AnkhBot at one point encrypted their user data, but upon joining StreamElements, they don’t anymore (I think).

To be clear, the ticket data is actually stored in the database. However, the table is cleared on when the bot is shut down (hence being cleared from memory).

I understand the want to keep the table, I really do. However,the problem isn’t with saving it, but loading.

Let’s say you have 1000 users entered into your raffle, ticket count isn’t important. Now let’s say it takes .3 seconds to load each user from the database into the raffle (Assume numbers which are overestimated). That would add an additional 300 seconds to the bots loading. Obviously it would load much faster than my numbers, but this is generally the reason why it’s not a feature.

A good example of this is the points table. Have you ever started your bot up, went into the panel and looked at the points, only for the page to go “dead” for a couple seconds? Yeah, same exact thing.

With a few edits I’m sure you could make the data save through a restart but officially, I don’t see it being supported.

I personally would opt for an option to export the data into a text file that can then be loaded via command.

They like to hide the button. It’s at the very very bottom with a little paypal icon.


I understand the desire to keep bot load time down.

I try to keep my bot running 24/7, but it’s running on a spare MacMini that needs the occasional reboot. This reboot just happened to take place part way through a week long raffle. Now that I know this is an issue, I’ll try and not reboot anything during raffles, but a system crash or power outage (or my fat foot hitting a surge protector) can’t be ruled out. I may just run an extra cord to the UPS the 3D printer is running off as some added insurance. Would love to move it over to AWS at some point though.

Just found the paypal icon in the footer, thanks for the tip! Might want to have that in the download section with a little “We’re free forever, but your support helps” as I know how frustrating it can be supporting an open source project that has frequent support and update requirements. And you guys are doing a great job on both fronts.

Thanks again,



I do want to be able to accomplish this one day, but for now storing this in the database is very slow. It’s been requested many times. I’ll see what can come in the future, but for now, it’s not possible.


That sounds good. As long as things like this are on the product radar, maybe future architecture/technology changes will make this more practical.

As with many things, it can easily be worked around once the bot owner understands how it works. Part of the challenge is that it is not readily apparent what is session based and what is persistant until you find out the hard way. Not much can be done about that beyond documentation, which people would likely not read any way! :wink:



So in the last week I’ve had 2 ticket raffles deactivate without the system being rebooted. Not sure what’s happening. Suddenly it stops responding to the “!tickets” command and “!ticekts 1” responds with “There is no ticket raffle opened.”

What other things could be causing an open raffle to close, other than the bot restarting or clicking “Close Raffle”?

This one really has me stressing out as we are doing a lot of week-long raffles and have only had 1 out of 4 work. First was canceled by a system reboot during a software update, and the last 2 just stopped with no clear reason.

I’ve had to start doing my raffles outside of the bot, since people are entering and losing their tickets/points. Not sure what else to do.



Do you have a timer set on the raffle? That’s the only thing I can think of right now.

I’m thinking of doing a revamp for our raffle systems, I’ll see if I can implement an option to save data, it would probably be a command (button for the panel) though, to avoid any performance issues with writing constantly to the database.


These have all been ticket raffles, which don’t have a time setting. They should, theoretically, remain open unless the bot restarts or you click to end it. But somehow, and I can’t figure out the cause, the last 2 just stopped.

What’s odd is that it’s hard to tell if the ticket raffle has ended. Normally if you type “!tickets” the raffle lets you know it’s running and how many tickets you have, but if the raffle has been stopped the “!tickets” command has no response. But if you pass a parameter (!tickets 1) it will let you know there is no active raffle. One would expect the command to respond either way.

A revamp of the raffle system might not be a bad idea, especially since it’s been so volatile. I really feel bad every time we have to got back and refund points to everyone who entered. At least with the way it has failed the last 2 times it shows all the entrants.

It would be amazing if there was a way from the admin interface to enter people as well, that way I could at least recover from this type of bug. What I had to do last time was re-open the raffle, and then take all the old entries, and all the new entries and manually enter them into a text document with one name on each line, repeating names based on how many tickets they have. That way I could just pick a random line number. It worked, but with so many entrants it was a lot of work to do in the middle of a stream. Looks like I’ll have to do that again this time.


A revamp will be done for sure, I’ve already started the core of it, I’ll just need to finish it when I get a bit more time, with Christmas coming i’m not too sure how much free time I’ll have.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.