You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
812 B
41 lines
812 B
import os
|
|
import re
|
|
import asyncio
|
|
from typing import Set
|
|
from datetime import datetime
|
|
import json
|
|
|
|
from quart import Quart, render_template, request, redirect
|
|
import bottom
|
|
|
|
import settings
|
|
|
|
irc_bot = None
|
|
connected_websockets: Set[asyncio.Queue] = set()
|
|
|
|
|
|
async def _setup_irc(app: Quart):
|
|
global irc_bot
|
|
loop = asyncio.get_event_loop()
|
|
irc_bot = bottom.Client(host=settings.IRC_HOST, port=settings.IRC_PORT, ssl=settings.IRC_SSL, loop=loop)
|
|
from ircserver.irc import start
|
|
start()
|
|
#asyncio.create_task(message_worker())
|
|
|
|
|
|
async def process_loop():
|
|
while True:
|
|
await asyncio.sleep(1)
|
|
|
|
|
|
def create_app():
|
|
global app
|
|
app = Quart(__name__)
|
|
|
|
@app.before_serving
|
|
async def startup():
|
|
await _setup_irc(app)
|
|
import ircserver.routes
|
|
|
|
return app
|