Last.FM Command & Auto Announce On Song Change



Command for current song and auto announce on song change for people using Last.FM.


First go to LastFM to create your api account.

Then you will need to run 2 commands to make the settings for this to work.

  1. !lastfm username [LastFM Username]
  2. !lastfm apikey [LastFM API Key]

after this you may check the current command using !lastfm or you can toggle the announcement using !lastfm toggle auto

lastFMSystem.js (6.1 KB)
system-lastFMSystem.js (806 Bytes)

Sample Below;

Spotify Now Playing

using this works perfectly thanks!!


I have installed and set this up, however the !lastfm command does not work.

Is this only enabled when I’m live or should it work even when I’m offline?

Hosting Own Channel


The first time running it didn’t update until after rebooting the bot [ found by bennnndaniels ]

lastFMSystem.js (6.3 KB)
system-lastFMSystem.js (671 Bytes)



Fixes: [Edited by UsernamesSuck]

  • All settings move to one area.
  • Added a toggle for announcing the song.
  • Added a toggle to save current song to file.
  • Added a error message if the settings have not been set.
  • Removed the auto setting in-place of the 2 above.

lastFMSystem.js (6.1 KB)
system-lastFMSystem.js (806 Bytes)


Well I tried to set it up and I did it like said above and my bot still spams It isn’t set up. Could be there a way to make these settings in the bot login txt file even when I muted my bot it spamed in the console it isn’t set up so I had to remove it.


Even though I would love to add this to the bot, it spams chat like crazy about not being set up. So I guess I’ll wait until that gets fixed before adding it again.


thats wierd that it would do that ill look into it and see if mine does this too now maybe the last fm api was changed


Hey, when using both
lastFMSystem.js (6.3 KB)
system-lastFMSystem.js (671 Bytes)

The bot constantly spams chat with the following message:
>> [lastFMSystem] The username username or apikey apikey for lastFm is incorrect and must be changed.

Thanks :slight_smile: i’d love to get this working


Did you set the username and api key?


Its Not Working
Image from Gyazo


I recommend not including your API key in the video.

The script should respond when you run the lastfm apikey and lastfm username commands. The fact that it didn’t means you set it up wrong


Similar to @Frozentsbgg my chat is being flooded after the installation of the system and it’s language file. I attempt to use the commands to add the username and API key, but alas the bot floods itself out and wont accept any commands. Any thoughts?


I didn’t write the script but, this is suspect:

    var lastfm_auto = $.getSetIniDbBoolean('lastfmToggle', 'auto', true);

Which would default to the system being on when not configured. That should probably be

    var lastfm_auto = $.getSetIniDbBoolean('lastfmToggle', 'auto', false);

But, that won’t help if the script was already dropped in. I would probably comment out the following:

        setTimeout(function() {
		  setInterval(function() { checkNextsong(); }, 5e2, 'scripts::custom::systems::lastFMSystem.js');
        }, 1e3);

Turn on the script, run !lastfm username and !lastfm apikey then turn off the bot, make sure the setTimeout is back in operation (uncommented), then turn it back on. Then, in theory, I would think it is ready to go.