A handy bot for slack, to manage your trash videos!
Everybody loves trash videos, and most of the companies have some kind of channel for the random bs videos.
The goal of this project was to create a Slack app that can identify, and save these videos.
The bot has a DB that stores the videos, and can be used to fetch a random video, save it, and delete it.
It can also identify the last valid YouTube from the channel messages, and save it to the trashDatabase.
You can save a video with a command, or with Slack shortcuts.
It has a simple Ui, that can be found at the home screen of the app.
Client: Slack
Server: Python with bolt
- Slack
- psycopg2
- python-dotenv
- slack-bolt
- slack-sdk
- slackblocks
- Python 3.7
To run this project, you will need to add the following environment variables to your .env file
SLACK_APP_TOKEN
- The slack app token
SLACK_SIGNING_SECRET
- The slack signing secret
SLACK_BOT_TOKEN
- slack bot token
TRASH_CHANNEL_ID
- the channel id of the trash channel
DATABASE_URL
DATABASE_SSL
- 'disable' or 'require'
LOG_LEVEL
- logging.DEBUG or logging.INFO or logging.WARNING or logging.ERROR or logging.CRITICAL
for local development, you need to add the following environment variables to your .env file
PSQL_USER_NAME
PSQL_PASSWORD
PSQL_HOST
PSQL_DB_NAME
PSQL_PORT
DATABASE_SSL='disable'
Clone the project
git clone https://github.com/NorbertRuff/trashBot
Go to the project directory
cd my-project
Install pip if you don't have it yet
pip3 (sudo apt install python3-pip)
Create a virtual environment
python3 -m venv <name_of_virtualenv>
Activate the virtual environment
source <name_of_virtualenv>/bin/activate
Install dependencies
pip3 install -r requirements.txt
Start the server
python3 main.py
Start docker container with:
docker-compose up -d
This also seeds the db with some videos
After install you have to set up your app on slack.
Add bot to channel, set up .env file
Add command endpoints /help /list /add
Add shortcut for adding videos.
commands:
- /help - show this message
- /add - add a new trash video
- /surprise - It will get a random trash video and posts it in the channel
- /list - list all trash videos
It can also save a video with the shortcut you find when clicking on a message ... thingy (meatballs menu?) and selecting the save shortcut.
Mention trashBot in a message and he can do the following: Mentions:
- @trashBot + 'help' -> It will print this message
- @trashBot + 'list' -> It will list all of the videos from the trash playlist
- @trashBot + 'random' or 'surprise' or 'trash' or 'video' -> It will get a random trash for you
- @trashBot + 'save' or 'add' or 'add to trash' +
Contributions, issues and feature requests are welcome!
Give a βοΈ if this project helped you!
-
π± Iβm currently learning React
-
π¨βπ» All of my projects are available at https://github.com/NorbertRuff
-
π« How to reach me [email protected]
|
|
|
|