bianvigano1 / SupahBot

Discord bot for music playback via youtube, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to SupahBot.

This bot is written in combination with Discord.js.

Command Description Example
!video get a link to a youtube video matching your search !video funny
!weather get current weather, defaults to Stockholm !weather London
!roll roll from 1-100 !roll
!help list all commands !help
!words list the most common words by user, defaults to you !words John
!queue enter a youtube URL to queue or a search word !queue house
!voteskip vote to skip the current song !voteskip
!song get the URL & title of the current song !song

The preferred way to deploy this Bot is via Heroku. Using Heroku means that the bot doesn't run on your computer, is active 24/7 and you don't have to worry about the ffmpeg installation, which is messy. Therefore this installation guide is going to describe how to do it.

Heroku is a service which provides servers and much, much more. Depending on your needs, the server (a.k.a. Dyno) is free of charge the time writing this guide, it will cost you nothing. You should create a Heroku account before proceeding.

Deploy

After deploying, click manage apps and "Configure Dynos", and make sure "worker node Bot.js" is switched on.

The accounts (needed to fill in the config variables on the Heroku deploy)

  • A new discord app (Bot)
  • A google developers account (to get a youtube API key to use for the bots playback service)
  • A openweathermap account (to use the bots weather service)

Creating these accounts will cost you nothing aswell, by the time writing this guide.

Step 1

NOTE: The bot can run without the weather and the playback service!

Step 2 (Recommended)

To be able to use the music playback service you need to create a google developers account

  • Go to https://console.developers.google.com/ and create and account if you don't have one
  • Create a project
  • When created, navigate to "Credentials" and create credentials (API key)
  • Save this key somewhere

Step 3 (Recommended)

To be able to use the weather service you need to create a openweathermap account

Manual deployment (if you want to make changes to the bot)

  • Fork this repository
  • Install Heroku CLI
  • In the terminal, place yourself in the directory where you cloned your fork of this repository
  • Login to heroku with the CLI:
heroku login
  • Create a new server:
heroku create
  • Add the buildpacks under .buildpacks. On https://dashboard.heroku.com/ head to the created server -> Settings and add these buildpacks on the Buildpacks section:
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/issueapp/heroku-buildpack-ffmpeg
  • Add the config variables prefixed with MY_VAR_ and UPPERCASED, it's time to use the API keys that you saved:
heroku config:set MY_VAR_DISCORD=YOUR_DISCORD_TOKEN
heroku config:set MY_VAR_OPENWEATHERMAP=YOUR_OPENWEATHERMAP_API_KEY
heroku config:set MY_VAR_YOUTUBE=YOUR_YOUTUBE_API_KEY
  • Deploy it:
git push heroku master

About

Discord bot for music playback via youtube, and more.

License:MIT License


Languages

Language:JavaScript 100.0%