/trashBot

A handy bot for slack, to manage your trash videos!

Primary LanguagePython

---|Trash Bot|---

logo

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.

---|👨‍💻 Tech Stack|---

Client: Slack

Server: Python with bolt

Packages

  • Slack
  • psycopg2
  • python-dotenv
  • slack-bolt
  • slack-sdk
  • slackblocks

Requirements

  • Python 3.7

Screenshots

screenshot


screenshot


screenshot


screenshot

screenshot

screenshot

---|⛑️Environment Variables|---

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'

---|🕶️Run Locally|---

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

Usage

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.

---|💺Usage/Examples|---

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' +

---|✍️ Contributing|---

Contributions, issues and feature requests are welcome!
Give a ⭐️ if this project helped you!

---|🚀 About Me|---

Hi 👋, I'm Norbert

A passionate developer from Apex Lab Hungary

norbertruff

Connect with me:

---|🔗 Links|---

portfolio

linkedin

My Github Stats

My Skill Set 👩‍💻

💻


🌐



🎨


prathmesh