コード例 #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()
                              })
コード例 #2
0
ファイル: bl.py プロジェクト: vasyukvv42/metabot
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()
                              })
コード例 #3
0
ファイル: test_utils.py プロジェクト: vasyukvv42/metabot
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']
コード例 #4
0
ファイル: test_utils.py プロジェクト: vasyukvv42/metabot
def test_get_current_channel_id_no_context() -> None:
    channel_id = get_current_channel_id()
    assert channel_id is None
コード例 #5
0
ファイル: test_utils.py プロジェクト: vasyukvv42/metabot
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']