4
0
mirror of https://github.com/jesopo/ircrobots synced 2024-06-26 17:57:06 +00:00
ircrobots/ircrobots/join_info.py

18 lines
568 B
Python
Raw Normal View History

from typing import Dict, Iterable, List, Optional
from irctokens import build
from ircstates.numerics import *
from .contexts import ServerContext
from .matching import Response, ANY, Folded
class WHOContext(ServerContext):
async def ensure(self, channel: str):
if self.server.isupport.whox:
await self.server.send(self.server.prepare_whox(channel))
else:
await self.server.send(build("WHO", [channel]))
line = await self.server.wait_for(
2020-04-28 10:45:46 +00:00
Response(RPL_ENDOFWHO, [ANY, Folded(channel)])
)