chillroom / jacr-bot

The bot for Just A Chill Room
GNU General Public License v3.0
0 stars 0 forks source link

Message of the Day (MOTD) system #4

Closed qaisjp closed 8 years ago

qaisjp commented 8 years ago

Delay for MOTD: delay = ?? seconds (currently 10 songs)

On load, the bot needs to:

  1. Get the MOTD info (isEnabled, nextMessage, messages, lastAnnounceTime)
  2. If NOT isEnabled or too soon (now() < lastAnnounceTime + delay), skip to end
  3. If nextMessage is not in messages, fix nextMessage
  4. Print the nextMessage in messages
  5. Update nextMessage and lastAnnounceTime
  6. Wait delay, then skip to beginning of this list

Add an interface to the admin panel to:

  1. Add messages to the cycler
  2. Remove messages from the cycler
  3. Reorder messages in the cycler
  4. Set the next message
  5. Note: Adding and removing messages may invalidate the "next message" ID, add a failsafe (only do this when it fails, not when making changes) to do a random ID
  6. Temporarily disable the cycler
Purnceks commented 8 years ago

set cycle to a set number of msgs, not a time or song, that way no matter how active the chat you won't ever fill up said chat with bot msgs

qaisjp commented 8 years ago

That's a good idea.