angelolz / RequestBot

A Discord/Twitch/Twitter Bot that allows people to give me (Angel!) spotify songs/albums and put it in a playlist through Spotify's API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angel's Request Bot

This bot allows users to give me (Angel) songs to listen to from Spotify and add them in a single playlist, utilizing the Spotify Web API. I wanted to make this bot because I wanted to experiment with multiple APIs: Twitch API, Spotify Web API, and Twitter API.

Bot Usage

The only valid links RequestBot can accept are either Spotify tracks or albums. The bot will only accept the album link if it has 20 tracks or less in it.

The available commands are listed below: * = Discord only, ** = Discord and Twitch

  • r!help *
  • r!ping *
  • r!add **
  • r!view **
  • r!recent *
  • r!np **

With each song/album submission, the bot keeps track where the submission came from and who submitted it, taking their Discord username and tag, Twitter handle, or Twitch username and storing it in a database.

Discord/Twitch

On Discord/Twitch, send the following command in a Discord server with the bot in it or in my own Twitch chat: r!add https://open.spotify.com/track/2CgOd0Lj5MuvOqzqdaAXtS

This will add a song to my playlist, and the bot will send a confirmation message to let you know that it has been added, as well as how many songs are in the playlist.

Examples

Discord Bot Usage

Discord Bot Usage

Twitch Bot Usage

Twitch Bot Usage

Twitter

On Twitter, all you need is to mention my twitter (@angelolz1) along with a Spotify link, optionally leaving a message in the tweet.

Once tweeted, my request bot will like your tweet and reply to your tweet to confirm that your song has been added to the playlist.

Example Tweet:

Example Tweet

Development Setup

  1. First off, you'd need to grab a bunch of api keys for this application. This should be pasted in a config.properties file.

    Spotify

    • Use the hidden Discord command r!set to get your authorization code.
    • The code will be found in the URL address. Use the r!set command again but provide your authorization code.

    Discord

    • Visit the developer dashboard.
    • Give your app a name, and click Create.
    • Click on the Bot menu on the left side and copy your token.
    • Paste the token in the d_bot_token field.

    Twitter

    • Visit the developer dashboard.
    • Click on the Create App button and give your app a name.
    • Copy the API Key and API Secret Key. Paste the keys in the twt_api_key and twt_api_secret_key fields, respectively.
    • Go to the settings of your app and change the app permissions to Read and Write.
    • Click on Overview to go to the main list of all your apps. Click on the key icon of the app you've created.
    • Click on the Generate button on the Access Token and Secret section.
    • Copy the Access Token and Access Token Secret. Paste the keys in the twt_access_token and twt_access_token_secret fields, respectively.

    Twitch

    • You can use an OAuth Generator page to get your token.
    • Copy and paste the token into the twch_oauth field.
  2. Create the required database and tables needed for the bot, which can be found in the tables.sql file.
  3. Enter your database credentials in the db.properties file.
  4. If everything was configured correctly, the app should run normally upon executing it.

Dependencies Used:

Support

Feel free to let me know of any bugs that you discover through my twitter (@angelolz1), which is the best way to reach me!

Contributing

This is my first time releasing open-source stuff, so my code could probably use some improvements from brilliant people like you! Feel free to open a pull request and describe the changes that you've made. I'll try my best to come back to it as soon as possible!

License

This project uses the MIT license.

About

A Discord/Twitch/Twitter Bot that allows people to give me (Angel!) spotify songs/albums and put it in a playlist through Spotify's API.

License:Apache License 2.0


Languages

Language:Java 100.0%