Silence more Discord errors

This commit is contained in:
Mathieu Comandon 2023-09-25 21:08:30 -07:00
parent 326f9d12fb
commit e98f19f5e0

View file

@ -1,4 +1,4 @@
from pypresence import Presence
from pypresence import Presence, DiscordNotFound
from lutris.util.discord.base import DiscordRichPresenceBase
@ -17,9 +17,11 @@ class DiscordRichPresenceClient(DiscordRichPresenceBase):
# Create a new Presence object with the desired app id
self.rpc = Presence(discord_id)
# Connect to discord endpoint
self.rpc.connect()
# Trigger an update making the status available
try:
self.rpc.connect()
except DiscordNotFound:
return
self.rpc.update()
def clear(self):