From 1d2450683ed7f4af835a545d92af9e94d7ac09bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 26 Nov 2023 20:34:50 +0100 Subject: [PATCH 1/2] add CONFIG.status --- lenaverse_bot/core/bot.py | 12 ++++++++++-- lenaverse_bot/core/config.py | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lenaverse_bot/core/bot.py b/lenaverse_bot/core/bot.py index 8542c0b..55212d5 100644 --- a/lenaverse_bot/core/bot.py +++ b/lenaverse_bot/core/bot.py @@ -3,13 +3,17 @@ import logging import discord from . import post, verein +from .config import CONFIG _logger = logging.getLogger(__name__) class LenaverseBot(discord.Client): def __init__(self) -> None: - super().__init__(intents=discord.Intents.default()) + super().__init__( + intents=discord.Intents.default(), + activity=discord.CustomActivity(name=CONFIG.status), + ) self.tree = discord.app_commands.CommandTree(self) commands = post.COMMANDS + verein.COMMANDS @@ -21,5 +25,9 @@ class LenaverseBot(discord.Client): _logger.info("Commands synced") async def on_ready(self) -> None: - assert self.user is not None + await self.wait_until_ready() + + if self.user is None: + return None + _logger.info(f"{self.user.name} has connected to Discord!") diff --git a/lenaverse_bot/core/config.py b/lenaverse_bot/core/config.py index 4f27992..490c54d 100644 --- a/lenaverse_bot/core/config.py +++ b/lenaverse_bot/core/config.py @@ -73,6 +73,7 @@ class Config(BaseModel): discord_token: str command_prefix: str command_failed: str + status: str post: Post ev_info: ClubInfo From 3301ad8c59d340b2d08b59207775677a9e8b4549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 26 Nov 2023 20:35:49 +0100 Subject: [PATCH 2/2] version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2a533e2..6bbb40e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ authors = ["Jörn-Michael Miehe "] description = "" name = "lenaverse_bot" readme = "README.md" -version = "0.1.0" +version = "0.2.0" [tool.poetry.dependencies] aiohttp = {extras = ["speedups"], version = "^3.9.0"}