GithubHelp home page GithubHelp logo

peregrine05 / spotify-song-of-the-day-bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21 KB

A Discord bot that sends daily a randomly-chosen song from a user-defined set of public Spotify playlists.

License: MIT License

Batchfile 0.91% Python 99.09%

spotify-song-of-the-day-bot's Introduction

Setup

  • Install Python. Version 3.8+ is recommended.
  • If you are using Windows, then double-click on the file: setup.bat. Wait for the process to complete. When complete, the console window will close.
  • Open the file .env with Notepad or another plain-text editor.
  • Go to https://developer.spotify.com/dashboard and create a new Spotify application.
    • The Redirect URI will not be used, so set it to http://localhost:3000 (or any unused port).
    • Select Web API to be used.
    • Read and agree to the developer agreement, and then save the application.
  • In the page to which you are redirected, in the top-right corner of the page, click Settings.
    • Copy the Client ID, and paste it into the .env file, after SPOTIPY_CLIENT_ID, such that the line reads, for example: SPOTIFY_APP_ID = 90d68b285173108bbe3349574480efd7.
    • Copy the Client secret, and paste it into the .env file, after SPOTIPY_CLIENT_SECRET, such that the line reads, for example: SPOTIFY_APP_SECRET = f8799153c6314f068e3d750bd166a47d.
  • Go to https://discord.com/developers/applications and create a new Discord application.
  • Go to the Bot tab.
    • Name the bot however you want and upload an avatar, if desired.
    • Click Reset Token.
    • Copy the token, and paste it into the .env file, after DISCORD_BOT_TOKEN, such that the line reads, for example: DISCORD_BOT_TOKEN = MTEyNjUzNTA5MDcyNjUwMjQwMA.GG_emt.cw3gIyIyMoHddWgcYRYle2Zq0bvLbh-n2bsi9w.
  • Save the .env file (Ctrl+S / File > Save).
  • Go to the OAuth2 > URL Generator tab.
    • Select the scopes: bot and applications.commands.
    • Select the bot permissions: Read Messages/View Channels, Send Messages, and Mention Everyone.
    • At the bottom of the page, Copy the generated url. Then paste it into the address bar of your browser and press Enter.
    • Add the bot to the server of your choice.
  • If you are using Windows, then double-click on the file: start.bat. The bot should shortly come online in the Discord server.

Bot Commands

Required commands

These commands must be used at least once in a server before the bot can function as intended.

  • /add_playlist: Adds a playlist specified by its URL to the playlist pool of the server. The playlist must be publicly accessible.
  • /set_time: Sets the time at which a random song is posted in the server. The time input is assumed to be in UTC (GMT time zone).
  • /set_channel: Sets the channel in which the random song will be posted.

Further configuration commands

These commands are used for further configuration or to view the current configuration.

  • /set_role: Sets a role to be mentioned when a random song is posted.
  • /clear_role: Clears the selected role from being mentioned when a random song is posted.
  • /remove_playlist: Removes a playlist specified by its URL from the playlist pool of the server.
  • /current_configuration: Retrieves the current configuration of the bot.
  • /exit_bot: Exits the bot. The start.bat file must be run to start the bot again.
  • /next_time: Retrieves the next time the bot will post a random song.
  • /random_track: Manually retrieve a random song from the playlist pool.

The bot configuration is stored in config.json. Modifying this file directly is not supported.

spotify-song-of-the-day-bot's People

Contributors

peregrine05 avatar

Watchers

 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.