We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 030f7b5 commit 16e998fCopy full SHA for 16e998f
nowplaying/social/misskey.py
@@ -13,5 +13,18 @@ def post(self, text):
13
self.client.notes_create(text = text)
14
15
def __str__(self):
16
- host = urlparse(self.client.meta()['uri']).hostname
17
- return f'Misskey (@{self.client.i()["username"]}@{host})'
+ host = self.client.address
+ user = self.user()
18
+ if user is not None:
19
+ return f'Misskey (@{user}@{host})'
20
+ else:
21
+ return f'Misskey ({host})'
22
+
23
+ def user(self):
24
+ try:
25
+ return self.client.i()["username"]
26
+ except Exception as e:
27
+ print(f'Failed to fetch username: {e}')
28
+ print(
29
+ 'This tends to happen if the server uses',
30
+ 'a Misskey fork such as Foundkey.')
0 commit comments