Compare commits
1 Commits
e9a800a093
...
25d72680cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 25d72680cb |
13
plugin.py
13
plugin.py
@ -51,14 +51,14 @@ class ListenBrainz(callbacks.Plugin):
|
||||
"""
|
||||
client = liblistenbrainz.ListenBrainz()
|
||||
listen = client.get_playing_now(user)
|
||||
if listen is not None:
|
||||
if listen is None:
|
||||
response = f"{user} doen't seem to be listening to anything"
|
||||
else:
|
||||
response = (
|
||||
f"{user} is currently playing: \x02{listen.track_name}\x0f "
|
||||
f"from \x02{listen.release_name}\x0f by \x02{listen.artist_name}\x0f "
|
||||
f"at \x02{listen.listened_at}\x0f"
|
||||
)
|
||||
else:
|
||||
response = f"{user} doen't seem to be listening to anything"
|
||||
irc.reply(response)
|
||||
|
||||
@wrap(["text"])
|
||||
@ -69,11 +69,10 @@ class ListenBrainz(callbacks.Plugin):
|
||||
"""
|
||||
client = liblistenbrainz.ListenBrainz()
|
||||
count = client.get_user_listen_count(user)
|
||||
if count is not None:
|
||||
response = f"{user} has recorded listening to {count} tracks"
|
||||
irc.reply(response)
|
||||
else:
|
||||
if count is None:
|
||||
response = "Nothing recorded"
|
||||
else:
|
||||
response = (f"{user} has recorded listening to {count} tracks")
|
||||
irc.reply(response)
|
||||
|
||||
@wrap(["text"])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user