README
- Forked and inspired by pybites/slackbot.
- Code for article How to Build a Simple Slack Bot.
Requirements
- Python 3.6+ (not tested on lower versions) with PIP
Optional
- Docker with Docker Compose
Install
- Clone the repository (or fork and clone).
- Copy or move secrets.yml.sample to secrets.yml.
Setup Slackbot
- Required:
slackbot.name
,slackbot.token
- Optional:
slackbot.id
- Create a new bot user
- Store the bot's username in secrets.yml as
slackbot.name
- Store the API Token in secrets.yml as
slackbot.token
- Note:
slackbot.id
is optional and will be determined at instantiation of NewsSlackBot
Setup Twitter
- Required:
consumer.key
,consumer.secret
,access.token
,access.token_secret
- Create a new Twitter app
- Look for Manage the keys and access tokens near the Consumer Key (API Keys) and make sure the Consumer and Access keys are generated.
- Store the Consumer Key in secrets.yml as
twitter.consumer.key
- Store the Consumer Secret in secrets.yml as
twitter.consumer.sercet
- Store the Access Token in secrets.yml as
twitter.access.token
- Store the Access Token Secret in secrets.yml as
twitter.access.token_secret
Install with Docker
-
Once you have finished secrets.yml, then we just build the image.
docker-compose build
Install with virtualenv
Not supported
Vanilla install
-
Assuming you have Python 3 installed, let's get the environment setup:
pip3 install -r requirements.txt
Run
- Be sure to setup the environment in Install first.
Run with Docker
-
Launch the container:
docker-compose up -d
Run with virtualenv
Not supported
Vanilla run
-
Run in the foreground:
./run.sh
OR background:
./run.sh &