def on_join(self, channel: str=None) -> Callable[[Callable], Callable]:
"""
Register a handler that's called after a channel is joined.
The handler is called with the `Channel` as argument, must be a coroutine
and is run non-blocking.
:param channel: channel to look out for or `None` for all channels
"""
def decorator(fn: Callable[[self.IrcMessage], None]):
jh = self.JoinHandler(channel, fn)
self._on_join_handlers.append(jh)
self._log.debug("Added join handler {}".format(jh))
return fn
return decorator
评论列表
文章目录