• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • Happy New Year everyone! A new version (1.0.0-beta.16) is out for Linux, fixing an issue that could lock the bot up when using it with TS3. Please visit the resources section or the main page (https://www.sinusbot.com) for the new package.

Requesting implementation of the javascript URL-API to the scripting engine.


Active Member
Hi, im currently working on API implementations for different platforms like spotify, youtube and google. Ive tried something like this:
function getOAuthURL(state = "", scope = [], show_diag = false) {
        var redirect = store.get('redirect_uri');
        if (!redirect) throw Error('There is no host saved. Please click on the script-link in the settings.');
        var redirect_uri = new URL(redirect)

        var client_id = config.client_id;
        if (!client_id) throw Error('Please specify a the client_id in the settings');

        var spotifyURL = new URL('https://accounts.spotify.com/authorize');
        if(state) spotifyURL.searchParams.append('state',state);
        if(scope.length) spotifyURL.searchParams.append('scope',scope.join(' '))
        if(show_diag) spotifyURL.searchParams.append("show_diag", show_diag.toString());

        return  spotifyURL.href;

Which doesn't work right now, because the URL-API is currently not implemented, i guess. Or is there some secret way to import it? Would be nice if this (or some other tool for uri manipulation) could be avaiable in the engine :)
Maybe you can take the implementation from Chromium.
Last edited: