post a chat message

        Arguments:
            channel_id:
                Scan token
431843
def post_chat_message(self, merchant_id, channel_id, message):
        

        return self.do_req('POST',
                           self.base_url + '/chat/v1/merchant/%s/channel/%s/message/' % (merchant_id, channel_id),
                           message)
579157
def chat_update(self, chat_id, data, **kwargs):
        ""
        api_path = "/api/v2/chats/{chat_id}"
        api_path = api_path.format(chat_id=chat_id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
753161
def join(channel)
      self.class.post('/channels.join', body: {name: channel, token: @token}).tap do |response|
        raise "error posting message: #{response.fetch('error', 'unknown error')}" unless response['ok']
      end
    end
1049576
def chat_getPermalink(
        self, *, channel: str, message_ts: str, **kwargs
    ) -> SlackResponse:
        
        kwargs.update({"channel": channel, "message_ts": message_ts})
        return self.api_call("chat.getPermalink", http_verb="GET", params=kwargs)
319649
def mark(self, channel_name, ts):
        
        channel_id = self.get_channel_id(channel_name)
        self.params.update({
            'channel':  channel_id,
            'ts':       ts,
            })
        return FromUrl('https://slack.com/api/channels.mark', self._requests)(data=self.params).post()
786110
def _post_message(message, chat_id, token):
    '''
    
    '''
    url = 'https://api.telegram.org/bot{0}/sendMessage'.format(token)

    parameters = dict()
    if chat_id:
        parameters['chat_id'] = chat_id
    if message:
        parameters['text'] = message

    try:
        response = requests.post(
            url,
            data=parameters
        )
        result = response.json()

        log.debug('Raw response of the telegram request is %s', response)

    except Exception:
        log.exception(
            'Sending telegram api request failed'
        )
        return False

    # Check if the Telegram Bot API returned successfully.
    if not result.get('ok', False):
        log.debug(
            'Sending telegram api request failed due to error %s (%s)',
            result.get('error_code'), result.get('description')
        )
        return False

    return True
1154813
def direct_reply(self, text):
        
        channel_id = self._client.open_dm_channel(self._get_user_id())
        self._client.rtm_send_message(channel_id, text)
817578
def per_callback_query_chat_id(types='all'):
    
    def f(msg):
        if (flavor(msg) == 'callback_query' and 'message' in msg
            and (types == 'all' or msg['message']['chat']['type'] in types)):
            return msg['message']['chat']['id']
        else:
            return None
    return f
682240
def send(self, channel, payload):
        
        with track('send_channel=' + channel):
            with track('create event'):
                Event.objects.create(
                    group=self,
                    channel=channel,
                    value=payload)
            ChannelGroup(str(self.pk)).send(
                    {'text': json.dumps({
                        'channel': channel,
                        'payload': payload
                    })})
253458
def send_message(self, app_mxit_id, target_user_ids, message='', contains_markup=True,
                     spool=None, spool_timeout=None, links=None, scope='message/send'):
        

        data = {
            'From': app_mxit_id,
            'To': ",".join(target_user_ids),
            'Body': message,
            'ContainsMarkup': contains_markup
        }

        if spool:
            data['Spool'] = spool
        if spool_timeout:
            data['SpoolTimeOut'] = spool_timeout
        if links:
            data['Links'] = links

        return _post(
            token=self.oauth.get_app_token(scope),
            uri='/message/send',
            data=data
        )
776117
async def send_message(self, event=None):
        
        if not self.cl.is_connected():
            return

        # The user needs to configure a chat where the message should be sent.
        #
        # If the chat ID does not exist, it was not valid and the user must
        # configure one; hint them by changing the background to red.
        if not self.chat_id:
            self.chat.configure(bg='red')
            self.chat.focus()
            return

        # Get the message, clear the text field and focus it again
        text = self.message.get().strip()
        self.message.delete(0, tkinter.END)
        self.message.focus()
        if not text:
            return

        # NOTE: This part is optional but supports editing messages
        #       You can remove it if you find it too complicated.
        #
        # Check if the edit matches any text
        m = EDIT.match(text)
        if m:
            find = re.compile(m.group(1).lstrip())
            # Cannot reversed(enumerate(...)), use index
            for i in reversed(range(len(self.sent_text))):
                msg_id, msg_text = self.sent_text[i]
                if find.search(msg_text):
                    # Found text to replace, so replace it and edit
                    new = find.sub(m.group(2), msg_text)
                    self.sent_text[i] = (msg_id, new)
                    await self.cl.edit_message(self.chat_id, msg_id, new)

                    # Notify that a replacement was made
                    self.log.insert(tkinter.END, '(message edited: {} -> {})\n'
                                    .format(msg_text, new))
                    self.log.yview(tkinter.END)
                    return

        # Check if we want to delete the message
        m = DELETE.match(text)
        if m:
            try:
                delete = self.message_ids.pop(-int(m.group(1)))
            except IndexError:
                pass
            else:
                await self.cl.delete_messages(self.chat_id, delete)
                # Notify that a message was deleted
                self.log.insert(tkinter.END, '(message deleted)\n')
                self.log.yview(tkinter.END)
                return

        # Check if we want to reply to some message
        reply_to = None
        m = REPLY.match(text)
        if m:
            text = m.group(2)
            try:
                reply_to = self.message_ids[-int(m.group(1))]
            except IndexError:
                pass

        # NOTE: This part is no longer optional. It sends the message.
        # Send the message text and get back the sent message object
        message = await self.cl.send_message(self.chat_id, text,
                                             reply_to=reply_to)

        # Save the sent message ID and text to allow edits
        self.sent_text.append((message.id, text))

        # Process the sent message as if it were an event
        await self.on_message(message)
973852
def Message(self, Id=0):
        
        o = ChatMessage(self, Id)
        o.Status # Test if such an id is known.
        return o
1365097
def sendChatAction(self, chat_id, action):
        
        p = _strip(locals())
        return self._api_request('sendChatAction', _rectify(p))
532944
async def respond(self, *args, **kwargs):
        
        return await self._client.send_message(
            await self.get_input_chat(), *args, **kwargs)
287444
def send(self, message_id, args=[], kwargs={}):
        
        self._logger.debug('Send {} in stm {}'.format(message_id, self.id))
        self._driver._add_event(
            event_id=message_id, args=args, kwargs=kwargs, stm=self)
877316
def send_message(chat_id):
    

    files = request.files

    if files:
        res = send_media(chat_id, request)
    else:
        message = request.form.get('message')
        res = g.driver.chat_send_message(chat_id, message)

    if res:
        return jsonify(res)
    else:
        return False
1214199
def chat(self, message):
    """"""
    if message:
      action_chat = sc_pb.ActionChat(
          channel=sc_pb.ActionChat.Broadcast, message=message)
      action = sc_pb.Action(action_chat=action_chat)
      return self.act(action)