feat(chat): support mp/playlist chat

This commit is contained in:
MingxuanGame
2025-08-16 08:42:40 +00:00
parent 368bdfe588
commit 3de73f2420
9 changed files with 206 additions and 10 deletions

View File

@@ -24,6 +24,11 @@ class RedisSubscriber:
del self.handlers[channel]
await self.pubsub.unsubscribe(channel)
def add_handler(self, channel: str, handler: Callable[[str, str], Awaitable[Any]]):
if channel not in self.handlers:
self.handlers[channel] = []
self.handlers[channel].append(handler)
async def listen(self):
while True:
message = await self.pubsub.get_message(