vsTerminus / Discord-NP

Last.FM Now Playing info in your Discord status message
MIT License
43 stars 6 forks source link

Error every interval: $VAR1 = 'Use of uninitialized value in concatenation (.) or string #21

Closed earnestma closed 3 years ago

earnestma commented 3 years ago
~/discordnp
:: ./discordnp.exe
Mon Mar  1 13:02:20 2021 - Loaded Config: config.ini
Mon Mar  1 13:02:20 2021 - Discord Token: OK (Ends with ***)
Mon Mar  1 13:02:20 2021 - LastFM API Key: OK (Ends with ***)
Mon Mar  1 13:02:20 2021 - LastFM User: earnestma
Mon Mar  1 13:02:21 2021 - Connected to Discord
$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

guild member update
Mojo::Reactor::Poll: I/O watcher failed: Can't call method "add_member" on an undefined value at C:\Users\earne\AppData\Local\Temp\par-6561726e65\cache-30fe91174516285d35d929feb7d0f7db51160d81\inc\lib/Mojo/Discord/Gateway.pm line 798.
guild member update
Mojo::Reactor::Poll: I/O watcher failed: Can't call method "add_member" on an undefined value at C:\Users\earne\AppData\Local\Temp\par-6561726e65\cache-30fe91174516285d35d929feb7d0f7db51160d81\inc\lib/Mojo/Discord/Gateway.pm line 798.
$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

$VAR1 = 'Use of uninitialized value in concatenation (.) or string at C:\\Users\\earne\\AppData\\Local\\Temp\\par-6561726e65\\cache-30fe91174516285d35d929feb7d0f7db51160d81\\inc\\lib/Discord/NP.pm line 53.
';

I am using the compiled Windows binary from https://github.com/vsTerminus/Discord-NP/releases/tag/1.4 running through Git Bash.

My config.ini:

[lastfm]
# You will need a Last.FM Developer API account for this script to work.
# There is no way around it, since the request requires an API key and I will not share my own.
# Fortunately, this is easy to get! Simply head over to http://www.last.fm/api/account/create
# Once your account is created, the site will display your API Key and API Secret.
# WRITE THESE DOWN! Last.FM apparently has no way to look them up later, so don't lose them.
# This script only requires the api key.
api_key = *****

# You'll also need to provide your Last.FM username for the script to query.
username = earnestma

# Provide an interval (in seconds). This tells the script how often it should
# check what you're listening to.
interval = 15

# These next two determine what shows up in the sidebar under your name where it says "Listening to ..."
# Yes to both: "artist - title" (eg "Devin Townsend - Genesis")
# Yes to artist only: "artist" (eg "Devin Townsend")
# Yes to title only: "title" (eg "Genesis")
# No to both: "Music"
# In any case, clicking on your name will show Artist, Title, and Album info in the popup.
show_artist = yes
show_title = yes

[discord]
# You need your discord user token so the script can log in as you and set your status.
#
# DISCLAIMER:
# YOU SHOULD CONSIDER THIS CAREFULLY. The discord token is like your password. Take care not to share it with anyone!
# You should absolutely look at the source code for yourself before you entrust any application (even this one!) with your token.
#
# If you still wish to proceed, learn how to get your token from here: https://discordhelp.net/discord-token
# It should look something like this (but longer): Mzk1MjY1.DgAknw.IiTvP8eSNRD
token = mfa.******

# Logging - This script will record a log of events to disk.
# log_dir should be set to a folder you have access to. Do not add a trailing slash.
# log_level can be one of: debug, info, warn, error, fatal, none
# Default value logs only warnings and fatal errors, and defaults to the same folder the script is in.
log_dir=.
log_level=fatal
vsTerminus commented 3 years ago

Thanks for the awesome detail. I think it's an issue of it being compiled against the wrong version of my Mojo::Discord library. I'll update it and let you know when to grab a new copy.

vsTerminus commented 3 years ago

Please try https://github.com/vsTerminus/Discord-NP/releases/tag/1.5

earnestma commented 3 years ago

Sorry, I'm still seeing the same error.

vsTerminus commented 3 years ago

Please try the attached version.

Changelog:

discord-np-1.5.1-windows.zip

earnestma commented 3 years ago

...all the versions work! Turns out, I had to disable hiding recent listening information from lastfm 🤦🏻‍♂️

image

Maybe a note of that should be added to the readme?

vsTerminus commented 3 years ago

LOL Good news!

I'll add that to the README as a setting to double check. Glad it's working now!