mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-06 14:50:34 +01:00
35 lines
862 B
Python
35 lines
862 B
Python
import locale
|
|
import logging
|
|
import threading
|
|
|
|
from webapp import webapp
|
|
from discordbot import bot
|
|
from twitchbot import twitchBot
|
|
|
|
|
|
def start_server():
|
|
logging.info("Démarrage du serveur web")
|
|
from waitress import serve
|
|
serve(webapp, host="0.0.0.0", port=5000)
|
|
|
|
def start_discord_bot():
|
|
logging.info("Démarrage du bot Discord")
|
|
with webapp.app_context():
|
|
bot.begin()
|
|
|
|
def start_twitch_bot():
|
|
logging.info("Démarrage du bot Twitch")
|
|
with webapp.app_context():
|
|
twitchBot.begin()
|
|
|
|
if __name__ == '__main__':
|
|
locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8')
|
|
|
|
jobs = []
|
|
jobs.append(threading.Thread(target=start_discord_bot))
|
|
jobs.append(threading.Thread(target=start_server))
|
|
jobs.append(threading.Thread(target=start_twitch_bot))
|
|
|
|
for job in jobs: job.start()
|
|
for job in jobs: job.join()
|