Giter Site home page Giter Site logo

kazagumo-spotify's Introduction

Hi there 👋

Takiyo desu~. I love animes so much. Beside that, i love coding too! I'm still a beginner at coding and i'll try my best here.
I'm a student, so my code time might be divided by my school time :(
I know Japanese and am studying it. I usually understand what is being said but it is difficult to talk about it because I can only pronounce it word by word and not make sentences.

takiyo0

takiyo0

  • 🌱 I’m currently learning idk

Connect with me:

takiyo0 takiyo0 takiyo takahashi takiyo04 takiyo nPPW2Gzqg2

Languages and Tools:

azure bash bootstrap bulma css3 electron express figma grafana html5 java javascript linux mongodb nginx nodejs photoshop postman react reactnative sqlite typescript

takiyo0

 takiyo0

takiyo0

kazagumo-spotify's People

Contributors

rainyxeon avatar sarcasterxo avatar takiyo0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kazagumo-spotify's Issues

kazagumo-spotify runs <Kazagumo>.search() without any input

kazagumo-spotify executes <Kazagumo>.search() (without any input) after node is disconnected (actually after lavalink server dies and not disconnects, and also assuming there is a player playing), it immediately calls <Kazagumo>.getLeastUsedNode() and crashes the bot.

the question is, why does it execute <Kazagumo>.search() without any input?
I request the developers to fix this problem.
thank you.

stack trace:

KazagumoError: No nodes are online
    at Kazagumo.getLeastUsedNode (C:\Users\<USER>\Desktop\bot\node_modules\kazagumo\dist\Kazagumo.js:112:19)
    at Kazagumo.<anonymous> (C:\Users\<USER>\Desktop\bot\node_modules\kazagumo\dist\Kazagumo.js:124:144)
    at Generator.next (<anonymous>)
    at C:\Users\<USER>\Desktop\bot\node_modules\kazagumo\dist\Kazagumo.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\<USER>\Desktop\bot\node_modules\kazagumo\dist\Kazagumo.js:4:12)
    at Kazagumo.search (C:\Users\<USER>\Desktop\bot\node_modules\kazagumo\dist\Kazagumo.js:123:16)
    at KazagumoPlugin.<anonymous> (C:\Users\<USER>\Desktop\bot\node_modules\kazagumo-spotify\dist\Plugin.js:62:25)
    at Generator.next (<anonymous>)
    at C:\Users\<USER>\Desktop\bot\node_modules\kazagumo-spotify\dist\Plugin.js:8:71 {
  code: 2
}

I've defined the player as the following code

const { Connectors } = require('shoukaku');
const { Kazagumo } = require("kazagumo");
const Spotify = require('kazagumo-spotify');

const Nodes = [...] // yes it is defined correctly in the actual code

client.kazagumo = new Kazagumo({
  plugins: [
    new Spotify({
      clientId: process.env.spotifyClientID,
      clientSecret: process.env.spotifyClientSecret,
      playlistPageLimit: 1,
      albumPageLimit: 1,
      searchLimit: 10,
      searchMarket: 'US',
    })
  ],
  defaultSearchEngine: "youtube",
  send: (guildId, payload) => {
    const guild = client.guilds.cache.get(guildId)
    if (guild) guild.shard.send(payload)
  }
}, new Connectors.DiscordJS(client), Nodes)

[Suggestion] Search track by ISRC

Making this modification to the plugin should be easy, given that Spotify already provides an ISRC on it's track object, as seen on the image.

Example for the Track "Tristeza Em Mim" by Sérgio Mendes
image

Searching the track's ISRC on Youtube given that it's a unique track identifier, returns more accurate results, with the artist's "topic" channel being the first ytsearch result, this could solve issues with the Youtube equivalent of the Spotify track being a remix, modified version of the track, or not even the original Spotify track at all.

If for some reason the ISRC is missing from Spotify's track object or if searching the ISRC doesn't return any results, the song could be searched for in the traditional way (Sending ytsearch:ArtistName - TrackTitle to Lavalink and picking the best match)

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.