mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-13 03:40:39 +01:00
discord bot dans l'interface web
This commit is contained in:
@@ -6,7 +6,7 @@ import asyncio
|
|||||||
from database.models import Humeur
|
from database.models import Humeur
|
||||||
from webapp import webapp
|
from webapp import webapp
|
||||||
|
|
||||||
class MyClient(discord.Client):
|
class DiscordBot(discord.Client):
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
logging.info(f'Logged in as {self.user} (ID: {self.user.id})')
|
logging.info(f'Logged in as {self.user} (ID: {self.user.id})')
|
||||||
for c in self.get_all_channels() :
|
for c in self.get_all_channels() :
|
||||||
@@ -22,7 +22,7 @@ class MyClient(discord.Client):
|
|||||||
await asyncio.sleep(60)
|
await asyncio.sleep(60)
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
client = MyClient(intents=intents)
|
bot = DiscordBot(intents=intents)
|
||||||
|
|
||||||
with webapp.app_context():
|
with webapp.app_context():
|
||||||
client.run(os.getenv('TOKEN'))
|
bot.run(os.getenv('TOKEN'))
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from webapp import webapp
|
from webapp import webapp
|
||||||
from discordbot import client
|
import discordbot
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
webapp.run(debug=True)
|
webapp.run(debug=True)
|
||||||
Reference in New Issue
Block a user