MCPcopy
hub / github.com/caronc/apprise / join

Method join

apprise/plugins/irc/client.py:297–320  ·  view source on GitHub ↗
(
        self,
        channel: str,
        timeout: float,
        prefix: str,
        key: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

295 return False
296
297 def join(
298 self,
299 channel: str,
300 timeout: float,
301 prefix: str,
302 key: Optional[str] = None,
303 ) -> None:
304
305 chan = normalise_channel(channel)
306 if chan in self.sm.ctx.joined:
307 # Nothing to do, we are already there.
308 return
309 deadline = time.monotonic() + float(timeout)
310
311 for act in self.sm.request_join(chan, key=key):
312 if act.kind == IRCActionKind.SEND and act.line:
313 self._queue(act.line)
314
315 while time.monotonic() < deadline and chan not in self.sm.ctx.joined:
316 self._flush(deadline)
317 self._handshake(self._tick(deadline), prefix=prefix)
318
319 if chan not in self.sm.ctx.joined:
320 logger.debug("IRC join confirmation not observed for %s", chan)
321
322 def privmsg(self, target: str, message: str, timeout: float) -> None:
323 """Handle the sending of private messages."""

Calls 6

_queueMethod · 0.95
_flushMethod · 0.95
_handshakeMethod · 0.95
_tickMethod · 0.95
normalise_channelFunction · 0.85
request_joinMethod · 0.80