Friday Bottle Lottery Bot for Slack
PePuBot is a Slack bot that can arrange Friday bottle lotteries on a Slack channel with a specific set of rules.
PePu comes from Finnish words “Perjantai Pullo”, which means “Friday Bottle”. Bot is shortened from Robot, as you may know. ;-)
- PePu is arranged in rounds, usually a round is arranged on every Friday, but it’s also possible to arrange a round on any other day or to skip rounds.
- When a PePu round is running in a channel anyone in the channel can attend and get a new ticket to the lottery box by posting a funny picture or video to the channel.
- Each attendee may get at most one new ticket to the lottery box per a PePu round. If the same person posts several pictures or videos to the PePu channel, only the first one is awarded with a ticket.
- When the round is ended, the winner will be selected by randomly picking one of the tickets from the lottery box. Then all tickets of the winner will be removed from the lottery box and the rest of the tickets will be stored for the next PePu round. I.e. your chances to win increase on every round until you win.
- Anyone can arrange a PePu round, but the person who starts the round should also arrange the prize bottle.
- The person who starts the round also decides when the round ends and is responsible to do so before the day ends.
To run PePuBot you need Python 3.7 and a Slack account.
Add a new app to Slack in https://api.slack.com/apps and add a bot for that app.
Enable the following permissions for the app:
- To act as a bot user in Slack
- For writing to the channel
- For marking ticket additions with reactions to the picture or video message.
- For filling user names to the tickets
Install PePuBot and its dependencies to a Python virtual environment or to a Docker container or using whatever isolation you prefer. You may do this with a command like:
pip install .
Copy the “Bot User OAuth Access Token” value to environment variable named SLACK_API_TOKEN or to a line in a configuration file named pepubot.conf. There is a pepubot.conf.template which you can use as a base.
- Note: Each configuration option can be set in the configuration file or with an environment variable with the same name. If a variable is defined in both places, the value will be read from the environment.
Start the PePuBot with the script installed by Pip:
By default the configuration file will be read from the current working directory by name pepubot.conf, but alternative location can be given via command line argument:
pepubot --config-file /path/to/pepubot.conf
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pepubot-0.1.0-py2.py3-none-any.whl (14.5 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size pepubot-0.1.0.tar.gz (13.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for pepubot-0.1.0-py2.py3-none-any.whl