Giter Club home page Giter Club logo

trashbot's Introduction

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

trashbot's People

Contributors

norbertruff avatar

Stargazers

 avatar

Watchers

 avatar

trashbot's Issues

[FEAT] [TRASHBOT] Send random trash video for a user

User Story:

As a member of the Apex Lab team I would like to send a trash video to a member, so I can make his/her day better.

AC:

  • Include the sender and receiver
  • Could be sent via private message or in "random" channel
  • Video can be random

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.