def on_welcome(self, connection: ServerConnection, event: Event):
        """Callback for when connection has been established

        Joins the Twitch chat and sends a message to confirm
        connection.

        Parameters
        ----------
        connection : ServerConnection
            Connection to Twitch server
        event : Event
            Event object for connection
        """

        for req in ("membership", "tags", "commands"):
            connection.cap("REQ", f":twitch.tv/{req}")

        connection.join(self.CHANNEL)
        self.send_message("Connected")
        LOG.info(
            f"Connected user {self.USERNAME} to twitch channel {self.CHANNEL[1:]}."
        )
Exemplo n.º 2
0
 def on_welcome(self, connection: client.ServerConnection,
                _: client.Event) -> None:
     if self.capabilities:
         connection.cap('REQ', *self.capabilities)
         connection.cap('END')
     connection.join(self.channel)