I've seen another bot recently that has a remarkable system for preventing spam when performing a keyword raffle: the bot will remove a user from the raffle if they type the keyword a second time.
I think implementing this feature into DeepBot would be a great idea as I have seen DeepBot hang on more than one occasion due to excessive keyword spam. When I say excessive spam, I mean the chat is flying by so fast, it's practically unusable and a mod has to enable either sub or slow mode to get the spam to stop. It's not because there's that many users in the chat, it's because everybody and their dog believes typing the keyword more than once gives them a better chance of winning. The result of this is that sometimes DeeepBot will hang and stop responding to anything, requiring a forced (TaskManager) close.
In order to implement this, I see two lists being required:
- Users who typed the keyword.
- Users in the raffle.
A three part test would have to be performed:
- If the user has not previously typed the keyword, enter them in the raffle.
- If the user has previously typed the keyword and they are in the raffle, remove them from the raffle.
- If the user has previously typed the keyword and they are not in the raffle, do nothing.
It might be worthwhile to add an option, such as a checkbox, to the raffle system to allow the streamer to choose whether or not to use spam prevention.