Coder Social home page Coder Social logo

supahbot's Introduction

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

supahbot's People

Contributors

razum90 avatar

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.