Giter Club home page Giter Club logo

spotify-enhancer's Introduction

Spotify Enhancer

What Is?

Spotify Enhancer is a Discord Bot built with Node.js that (currently) notifies the users of a given server which artists released new music. Those artists are chosen by the users, and the releases are printed to the specified channels.

Since the Spotify API is used to get the latest releases and it needs to request a lot of times (often hitting rate limit), the search of new releases is done hourly.

How it works?

As soon as the bot enters a new server, it will create a new channel called releases-commands where the people who have access to that channel have the possibility to configure which artists to follow, print releases of given artists, and so on.

Besides that, the bot will create a new role called New Releases Manager. People who have that role have the possibility to register and delete releases channels.

Register/Delete Releases Channels

In order to register releases channels, you need to go to a channel (except releases-commands) and type !SE addchannel. To remove a releases channel, type !SE removechannel.

Add Artists

As soon as the server have registered releases channels, it is possible to register artists. To do so, type !SE+ and the names/Spotify URL/URI of the artists seperated by commas.

Example:

!SE+ Coldplay, spotify:artist:6WMONlXvkrTWxC4TcI8qcD (use this if you only have one releases channel)
!SE+ Coldplay, spotify:artist:6WMONlXvkrTWxC4TcI8qcD #name_channel (use this if you have more than one releases channel)

Remove Artists

If you don't want to follow some artists anymore, you can remove them by typing !SE- and the names of the artists seperated by commas.

Example:

!SE- The Weeknd, Joji, Porter Robinson

Print New Releases of Artists

Sometimes on Spotify, the release that was supposed to be associated to a given artist is associated to a different one. If you want to print that release without registering the artist on the server, you can use !SE new.

Example:

!SE new Headhunterz, https://open.spotify.com/artist/2JqPH5sGxBA5lDMUmO5uAE?si=d8vw8bA9TlS0hxglNeFXQQ (use this if you only have one releases channel)
!SE new Headhunterz, https://open.spotify.com/artist/2JqPH5sGxBA5lDMUmO5uAE?si=d8vw8bA9TlS0hxglNeFXQQ #name_channel(use this if you have more than one releases channel)

Features

The main features of this bot were discussed in detail previously, although you can always take a look at the full list of features/commands when typing !SE help on Discord.

Note: !SE help will print different results depending on which channel you wrote the command.

Installation

Requirements

In order to run the bot on your machine, you need:

Steps

  1. Install all dependencies using:
npm install
  1. Rename the file config-example.json to config.json and replace the fields with your information.

If everything goes smoothly, you should see this in your console:

image-20200913193245156

Contributing

Pull requests and issues are always welcome! Feel free to fork and develop/suggest your ideas.

It is my first big solo project, and some parts of the code are not very well documented/organized. If you have any doubts/concerns about the code, don't hesitate to contact me by opening a new issue.

License

GNU General Public License v3.0

spotify-enhancer's People

Contributors

dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

loismarcin

spotify-enhancer's Issues

Update README.md

Update README.md with steps for installation, contributing, about, and many more

Some latest releases are not updated to the database

Describe the bug
If the latest releases are not from today or the next day (even if they are new), they will not be registered in the database.

Expected behavior
If there's a new release, it should be registered in the database (and possibly printed).

Optimize MongoDB functions file

Describe the optimization
The file mongoDB-funcs.js has quite some repetitive functions and it is very extense, which makes the process of maintaining/adding new features a lot more confusing.

How should it be optimized
Create separate files for the different types of functions, and delete similar ones.

Optimize releases file

Describe the optimization
The file releases.js is very extensive, which makes the process of maintaining/adding new features a lot more confusing. Also, it has some api requests that can possibly be deleted/changed.

How should it be optimized
Create separate files for the different types of functions, and delete similar ones. In regards to the api, try to delete/change as many requests as possible

Check if all guilds registered are available before the bot is online

Describe the bug
If someone decides to kick/ban the bot when it is offline, the bot doesn't know that has fewer guilds registered. In the future, can cause possible errors trying to send new releases to guilds that it doesn't know.

Expected behavior
Before the bot is ready to use (online), it's necessary to check if all guilds registered in the database are available.

Check if all releases channels registered are available before the bot is online

Describe the bug
If someone decides to delete a releases channel when it is offline, the bot doesn't know that those channels were deleted. In the future, can cause possible errors trying to send new releases to channels that don't exist.

Expected behavior
Before the bot is ready to use (online), it's necessary to check if all releases channels registered in the database are available.

Move several artists at the same time

Name of the command
!SE move

Describe how to enhance this command
Instead of moving one artist and calling the command several times, it would be more practical to move several artists at the same time with only one call (same behavior as !SE new, !SE+ and !SE-)

Bot freezes when there are no more artists left from the search

Describe the bug
When adding or finding the latest releases of a given artist, if there are no more artists left from the search, the bot throws an error and doesn't complete the operation.

Expected behavior
It should warn the user, saying that "x" artist does not exist and proceed/end the search process.

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.