FlorenceBot (Fremily Twitch Bot)

Fred & Emily (Fremily) are a couple stream on Twitch. They are awesome! Check them out!

They regularly give away game codes during stream but the system they had was very manual and sometimes there were mistakes when sending game codes to winners or when drawing winners. They were also looking to move away from the chatbot & donation service they were using so needed an alternative.

Here’s where FlorenceBot comes in.

It’s built from scratch using Ruby on Rails as the web framework and Cinch as the IRC chat client framework.

It’s hosted on a Vultr VPS in London, uses a MySQL database backend and Amazon S3 for storing some assets.

Public Game Submission

The game codes given away are mostly purchased by Fred and Emily but anyone from chat can submit any spare game codes they have. These are then kept in the database and added to the giveaway wheel.

Giveaway Wheel

The wheel is created as an OBS browser source. It is controlled from chat by any of the mods typing !wheel username. This uses Pusher to send a request to the OBS source. Once a game has been won from the wheel, the game is marked as won in the admin and is linked to the user who won it.

Admin Area

The Dashboard shows a quick overview of the number of games, giveaways and commands. It also shows the 10 recently won games so moderators can quickly see what games have been sent to winners.

Giveaways

Giveaways are started from chat when a moderator types !flogiveaway. This starts a timer of 2 minutes. When someone types !enter, it checks if they are a follower and if so, they are then entered into the giveaway. Once the 2 minute timer is up, it announces in chat. Tier 2 and Tier 3 subscribers are also automatically entered into the giveaway upon it starting.

Commands

Commands are very useful in chat. Maybe someone wants to check the !specs or maybe a mod needs to tell someone that this stream is !english only. They can be added or changed from here. There is also a 10 second timeout to prevent the same command being used more than once in that timeframe.

Exercise Counts

Fred & Emily are trying to keep fit. They asked me to add an exercise count system into the bot for new subscribers. This was also extended for bits. When someone subscribes, it adds a set number of exercises to the overall count. Exercises can be completed with the !done 10 command with the number being how many to remove. There is a 10 second timer for this to prevent more exercises being removed.

Counts

Counts can also be useful in chat. Want to count how many times you die in a certain game? Moderators have access to custom commands for each count to add or remove a set number from the count.

Clips / Tweets

Fred wanted a better way of sharing Twitch clips as tweets. I thought of creating a separate Twitter account for this and in about an hour, I had it working! In the admin area, there is a way to enter a message and enter a Twitch clip link. In the background, it downloads the clip video file and tweets it out on the @FremilyClips account with the supplied message and a mention of the person who clipped it, to give credit.

Fred also wanted a way for the public to submit clips which would, when approved by Fred, Emily or mods, would be tweeted out in the same way.

    Technologies Used:

  • Rails 6
  • Cinch
  • HAML
  • Pusher
  • Twitch API
  • Twitter API
  • AWS S3

Want something like this built for you? Contact me for a quote.