Add simple sockets channel implementation.

This commit is contained in:
2025-09-01 23:28:16 +10:00
parent 6667dc7263
commit c114f1a54a
3 changed files with 75 additions and 5 deletions
+6 -5
View File
@@ -4,7 +4,7 @@ import websockets
from twitchio.web import AiohttpAdapter
from meta import Bot, conf, setup_main_logger, args
from meta import Bot, conf, setup_main_logger, args, sockets
from data import Database
from modules import twitch_setup
@@ -30,10 +30,11 @@ async def main():
setup=twitch_setup,
)
try:
await bot.start()
finally:
await bot.close()
async with websockets.serve(sockets.root_handler, '', conf.wserver.getint('port')):
try:
await bot.start()
finally:
await bot.close()
def _main():