Beispiel #1
0
    def _init_impl(self):

        with self.update_lock:

            # Configuration of the underlying client
            client_config = {
                'token': self.config.secret,
                'proxies': get_proxy_config(self.config)
            }

            # Create the actual connection object
            self._impl = SlackClient(**client_config)

            # Confirm the connection was established
            self.ping()

            # We can assume we are connected now
            self.is_connected = True
Beispiel #2
0
    def _init_impl(self):

        with self.update_lock:

            # Configuration of the underlying client
            client_config = {
                'address': self.config.address,
                'connect_timeout': self.config.connect_timeout,
                'invoke_timeout': self.config.invoke_timeout,
                'token': self.config.secret or '<default-empty-telegram-token>',
                'proxies': get_proxy_config(self.config),
            }

            # Create the actual connection object
            self._impl = TelegramClient(**client_config)

            # Confirm the connection was established
            self.ping()

            # We can assume we are connected now
            self.is_connected = True