Example #1
0
async def _send_message_to_user(text: str,
                                blocks: Optional[List[Dict]] = None) -> None:
    await async_slack_request(method='chat_postEphemeral',
                              payload={
                                  'text': text,
                                  'blocks': blocks,
                                  'user': get_current_user_id(),
                                  'channel': get_current_channel_id()
                              })
Example #2
0
async def send_ephemeral(text: str) -> None:
    user = get_current_user_id()
    log.info(f'Sending ephemeral to user {user}: {text}')
    await async_slack_request(method='chat_postEphemeral',
                              payload={
                                  'text': text,
                                  'user': user,
                                  'channel': get_current_channel_id()
                              })
Example #3
0
def test_get_current_channel_id_action(test_action_metadata: Dict, ) -> None:
    channel_id = get_current_channel_id()
    assert channel_id == test_action_metadata['channel']['id']
Example #4
0
def test_get_current_channel_id_no_context() -> None:
    channel_id = get_current_channel_id()
    assert channel_id is None
Example #5
0
def test_get_current_channel_id_command(test_command_metadata: Dict, ) -> None:
    channel_id = get_current_channel_id()
    assert channel_id == test_command_metadata['channel_id']