From 2e653dff7524d96a9d9b0d38e0d1a2997fa9fe27 Mon Sep 17 00:00:00 2001 From: Boosik Date: Thu, 3 Mar 2022 16:50:38 +0100 Subject: [PATCH] Add new nextcord on_presence_update event --- custom_components/discord_game/sensor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/custom_components/discord_game/sensor.py b/custom_components/discord_game/sensor.py index b62c634..02fc515 100644 --- a/custom_components/discord_game/sensor.py +++ b/custom_components/discord_game/sensor.py @@ -295,6 +295,13 @@ async def on_member_update(before: Member, after: Member): if watcher is not None: await update_discord_entity(watcher, after) + # noinspection PyUnusedLocal + @bot.event + async def on_presence_update(before: Member, after: Member): + watcher = watchers.get("{}".format(after)) + if watcher is not None: + await update_discord_entity(watcher, after) + # noinspection PyUnusedLocal @bot.event async def on_user_update(before: User, after: User):