From fe3ac8ff6a1e657ee50182062083e687ccddc7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=A4ki?= Date: Tue, 20 Feb 2024 12:55:30 +0200 Subject: [PATCH] config initialization --- ovos_PHAL_plugin_discord_bot/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ovos_PHAL_plugin_discord_bot/__init__.py b/ovos_PHAL_plugin_discord_bot/__init__.py index 374519b..90ba28c 100644 --- a/ovos_PHAL_plugin_discord_bot/__init__.py +++ b/ovos_PHAL_plugin_discord_bot/__init__.py @@ -28,6 +28,11 @@ class DiscordBotPlugin(PHALPlugin): self.bus.on("configuration.updated", self.init_configuration) reinstall_hint = "pip install --upgrade --no-deps --force-reinstall git+https://git.sebastianmaki.fi/sebastian/ovos-PHAL-plugin-discord-bot.git" LOG.info(f"Reinstall hint: {reinstall_hint}") + + # Helper function to get Discord user by ID + async def get_discord_user_by_id(user_id) -> discord.User: + return await self.bot.fetch_user(user_id) + # Discord event: bot is ready @self.bot.event async def on_ready(): @@ -108,6 +113,4 @@ class DiscordBotPlugin(PHALPlugin): - # Helper function to get Discord user by ID - async def get_discord_user_by_id(user_id) -> discord.User: - return await self.bot.fetch_user(user_id) +