Skip to content

molecularmodelinglab/frog-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frog-bot

There was once a member of the molecular modeling lab that just loved frogs. So it only made sense that the lab slack had a bot that loved frogs as much as he did. A so, frog-bot was born

Install

Just clone the repo and install requirements. I tested for python 3.11, not sure if it runs with other versions.

git clone git@github.com:molecularmodelinglab/frog-bot.git
pip install -r requirements.txt

You also need to have the fortune command installed (so the bot currently only support unix systems)

sudo apt install fortune

To run you need just need to run main.py, which will start the bot. You will also need to set up something that allows slack to route requests to you bot. I just used ngrok and had it route traffic to my app. Not very secure or production worthy but it works and this is a frog bot.

You will also need to set the environment variables SLACK_BOT_TOKEN and SLACK_SIGNATURE to the correct tokens for your bot (you can get them from the bot admin page via slack)

The bot currently requires subscriptions to the app_mention and message.channels events. It will also need the following permissions

  • app_meantions:read
  • chat:write
  • commands
  • files.write
  • incoming-webhook
  • reactions.write

Functionality

Rigth now frog-bot does a few things.

Daily frog images

Every day, at 9am the frog bot will post a frog image to the 'frog-of-the-day' channel. It also include a random quote generated by fortune. Right now it will pick any quote even the "offensive" ones (that what the docs say), but you can change that command yourself if you want. As and example our bot has done this before:

Example Frog

Example Frog2

Warning

You will need to configure this to your desired channel-id, which is hard coded in main.py

Reacting to the word 'frog'

frog-bot with react with 🐸 to any message that contains the word "frog" in it (if the bot is in that channel)

/frog command

The /frog command will have the frog bot send a frog image to the channel with a cute message

App mentions

Whenever you @frog-bot, the bot will reply with a random number of ribbits (just like a real frog!)

Contributing

I love frogs. If you love frog feel free to add new frog images or new frog related function for the frog bot. Just make a pull request with your changes

Credits

The brain child of frog lover James Wellnitz (@jimmyjbling) It is also currently maintained in the MML slack by him and his SWAMP computer cluster (specically by bullfrog)

About

Our favorite frog slack bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages