def send_in_thread(self, thread_ts: str): """ Sends threaded message. :param ts: Timestamp of the original parent message which thread belongs to. """ return get_client(token=self.token).api_call('chat.postMessage', thread_ts=thread_ts, **self.message_params)
def send(self): return get_client(token=self.token).api_call( 'files.upload', body_encoding='data', files={'file': self.file_path}, **self.message_params, )
def update(self, ts): """ Updates the message with the timestamp :param ts: Timestamp of the message to update """ return get_client(token=self.token).api_call('chat.update', ts=ts, **self.message_params)
def send_ephemeral(self, user: User): return get_client(token=self.token).api_call( 'chat.postEphemeral', body_encoding='json', channel=self.channel.id, text=self.text, attachments=self.attachments, blocks=self.blocks, user=user.id)
def send(self): return get_client(token=self.token).api_call( 'dialog.open', body_encoding='json', dialog=self.dialog, trigger_id=self.trigger_id)
def open(self): return get_client(self.token).api_call('views.open', body_encoding='json', trigger_id=self.trigger_id, view=self.view)
def get_default_client(): try: return get_client() except NoSlackTokenError: return None
def using(cls, token): cls.client = get_client(token=token) return cls
def send(self): return get_client(token=self.token).api_call('chat.postMessage', **self.message_params)