@@ -0,0 +1,2051 @@
+import logging%0Aimport pylast%0A%0Afrom pajbot.modules import BaseModule, ModuleSetting%0Afrom pajbot.models.command import Command%0A%0Alog = logging.getLogger(__name__)%0A%0Aclass LastfmModule(BaseModule):%0A    ID = __name__.split('.')%5B-1%5D%0A    NAME = 'LastFM module'%0A    DESCRIPTION = 'This uses the LastFM api to fetch the current artist and songname that the streamer is listening to on spotify or youtube.'%0A%0A    def load_commands(self, **options):%0A        self.commands%5B'song'%5D = Command.raw_command(self.song,%0A                delay_all=12,%0A                delay_user=25,%0A                description='Check what that is playing on the stream',%0A                examples=%5B%0A                    CommandExample(None, 'Check the current song',%0A                        chat='user:!song%5Cn'%0A                        'bot: Current Song is %5Cu2669%5Cu266a%5Cu266b Adele - Hello %5Cu266c%5Cu266b%5Cu2669',%0A                        description='Bot mentions the name of the song and the artist currently playing on stream').parse(),%0A                    %5D,%0A                )%0A        self.commands%5B'currentsong'%5D = self.commands%5B'song'%5D%0A        self.commands%5B'nowplaying'%5D = self.commands%5B'song'%5D%0A        self.commands%5B'playing'%5D = self.commands%5B'song'%5D%0A%0A    def song(self, **options):%0A        source = options%5B'source'%5D%0A        bot = options%5B'bot'%5D%0A%0A        API_KEY = bot.config%5B'lastfm'%5D%5B'api_key'%5D #%22f6a3b7b12549aa211a6deec453c79417%22%0A        lastfmname = bot.config%5B'lastfm'%5D%5B'user'%5D #%22anniefuchsia%22%0A        network = pylast.LastFMNetwork(api_key = API_KEY, api_secret =%22%22, username = lastfmname, password_hash =%22%22)%0A        try:%0A            user = network.get_user(lastfmname)%0A            currentTrack = user.get_now_playing()%0A            if currentTrack == None:%0A                bot.me('%7B%7D isn%5C't playing music right now!'.format(bot.streamer))%0A            else:%0A                bot.me('Current Song is %5Cu2669%5Cu266a%5Cu266b %7B0%7D %5Cu266c%5Cu266b%5Cu2669'.format(currentTrack))%0A        except IndexError:%0A            bot.me('I have trouble fetching the song name.. Please try again FeelsBadMan')%0A

Create lastfm.py