From c67a70acf835e17c868f35dfe38405e4437ae8a0 Mon Sep 17 00:00:00 2001 From: Kepka Ludovic Date: Sat, 9 Aug 2025 11:53:40 +0200 Subject: [PATCH] discord bot dans l'interface web --- discordbot/__init__.py | 6 +++--- run-web.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discordbot/__init__.py b/discordbot/__init__.py index ba5f69d..d03faad 100644 --- a/discordbot/__init__.py +++ b/discordbot/__init__.py @@ -6,7 +6,7 @@ import asyncio from database.models import Humeur from webapp import webapp -class MyClient(discord.Client): +class DiscordBot(discord.Client): async def on_ready(self): logging.info(f'Logged in as {self.user} (ID: {self.user.id})') for c in self.get_all_channels() : @@ -22,7 +22,7 @@ class MyClient(discord.Client): await asyncio.sleep(60) intents = discord.Intents.default() -client = MyClient(intents=intents) +bot = DiscordBot(intents=intents) with webapp.app_context(): - client.run(os.getenv('TOKEN')) \ No newline at end of file + bot.run(os.getenv('TOKEN')) \ No newline at end of file diff --git a/run-web.py b/run-web.py index ccd87b9..91af726 100644 --- a/run-web.py +++ b/run-web.py @@ -1,5 +1,5 @@ from webapp import webapp -from discordbot import client +import discordbot if __name__ == '__main__': webapp.run(debug=True) \ No newline at end of file