From 33b50af691eed070604034a7f0a5e3d24b0031b4 Mon Sep 17 00:00:00 2001 From: Leonid Meleshin Date: Tue, 7 Nov 2023 15:56:32 +0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Log=20bot=20account=20on=20start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- aicord/discord/bot.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0724e90..3a5e9a7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "Python: Bot", "type": "python", "request": "launch", - "program": "${workspaceFolder}/bot.py", + "module": "aicord", "console": "integratedTerminal", "justMyCode": true } diff --git a/aicord/discord/bot.py b/aicord/discord/bot.py index 6ff3a6f..bb7725d 100644 --- a/aicord/discord/bot.py +++ b/aicord/discord/bot.py @@ -20,10 +20,15 @@ def __init__(self, config: BotConfig) -> None: self.config: BotConfig = config + async def on_ready(self): + print(f"Logged in as {self.user} (ID: {self.user.id})") + print("------") + def run(self) -> None: raise NotImplementedError("Please use `.start()` instead.") async def start(self) -> None: + print("Starting bot...") await super().start(os.environ['DISCORD_TOKEN'])