'An error occcured whilst re-authorising your Spotify account. Please try again later.'
)
end
redis:set(
'spotify:'..message.from.id..':access_token',
jdat.access_token
)
redis:expire(
'spotify:'..message.from.id..':access_token',
3600
)
mattata.edit_message_text(
message.chat.id,
wait_message.result.message_id,
'Successfully re-authorised your Spotify account! Processing your original request...'
)
else
localsuccess=mattata.send_force_reply(
message,
'You need to authorise mattata in order to connect your Spotify account. Click [here](https://accounts.spotify.com/en/authorize?client_id='..url.escape(configuration['keys']['spotify']['client_id'])..'&response_type=code&redirect_uri='..configuration['keys']['spotify']['redirect_uri']..'&scope=user-library-read,playlist-read-private,playlist-read-collaborative,user-read-private,user-read-birthdate,user-read-email,user-follow-read,user-top-read,user-read-playback-state,user-read-recently-played,user-read-currently-playing,user-modify-playback-state) and press the green "OKAY" button to link mattata to your Spotify account. After you\'ve done that, send the link you were redirected to (it should begin with "'..configuration['keys']['spotify']['redirect_uri']..'", followed by a unique code) in reply to this message.',