medoror / audio_clipper_slackbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audio Clipper

A couple of months ago, I tried to be funny on a personal slack channel. One of my friends made a comment in our group slack channel and I tried to reply with an audio reaction.

I found a video on youtube with the relevant audio and posted the link in the channel but the execution was not great. The funniest joke ever was ruined because:

  1. The video had ads
  2. The video played a longer portion of the audio I wanted

Feeling jarred. I decided to take this opportunity to try and fix this so my jokes would never get ruined again.

This repo represents my MVP attempt to upload sound clips via a slackbot. Instead of posting a link, this bot will take a youtube video and upload the audio as an mp3. At this time it has the following usages

Usage

Usage 1 - /audio https://www.youtube.com/watch?v=WBC_CepxWHU This will upload audio from the beginning of the given youtube url up to the given duration (in seconds). If no duration is given, the default is 10 seconds.

Usage 2 - /audio https://youtu.be/WBC_CepxWHU?t=3 3 This will upload audio from the beginning of a given youtube url at the timestamp up to the given duration (in seconds).

Deploying the slackbot

  1. Clone this repo
  2. cp _env .env
  3. source .env
  4. Add your slack secret and token to your env files
  5. yarn build to generate javascript files
  6. Follow the instructions to deploy and manage: https://slack.dev/bolt-js/deployments/aws-lambda

About

License:MIT License


Languages

Language:TypeScript 96.8%Language:JavaScript 2.3%Language:Shell 0.9%