Send a message to the google chat room specified in the webhook url.

    .. code-block:: bash

        salt '*' google_chat.send_message "https://chat.googleapis.com/v1/spaces/example_space/messages?key=example_key" "This is a test message"
1609
def send_message(url, message):
    '''
    
    '''
    headers = {'Content-Type': 'application/json'}
    data = {'text': message}
    result = __utils__['http.query'](url,
                                     'POST',
                                     data=json.dumps(data),
                                     header_dict=headers,
                                     decode=True,
                                     status=True)

    if result.get('status', 0) == 200:
        return True
    else:
        return False
787170
def send_msg_to_webhook(self, message):
        
        payload = {
            'content':message
        }

        header = {
            'Content-Type':'application/json'
        }

        try:
            request = requests.post(
                self.api_url,
                headers=header,
                json=payload
            )
            request.raise_for_status()
        except Exception as error_msg:  #pragma: no cover
            warning_msg = (
                'EXCEPTION: UNABLE TO COMMIT LOG MESSAGE' +
                '\n\texception={0}'.format(repr(error_msg)) +
                '\n\tmessage={0}'.format(message)
            )
            warnings.warn(
                warning_msg,
                exceptions.WebhookFailedEmitWarning
            )
822639
def send(self, group_id=None, message_dict=None):
        
        if self.group is not None and self.group.id is not None:
            group_id = self.group.id

        path = 'message/%s' % group_id

        if message_dict is not None:
            request_data = {
                'message': message_dict,
            }
        else:
            subject = self.subject
            text = self.text
            markdown = self.markdown

            request_data = {
                'message': {},
            }
            if subject:
                request_data['message']['subject'] = subject
            if text:
                request_data['message']['text'] = text
            if markdown:
                request_data['message']['markdown'] = markdown

        response_data = self.api.request(path, request_data)

        self.id = response_data['message_id']
        self.thread_id = response_data['thread_id']
        self.sent_message = FiestaMessage(self.api, response_data['message'])
123486
async def send(self, clear=True, parse_mode=()):
        
        await self._client.send_message(
            self._peer, self.text, reply_to=self.reply_to_msg_id,
            link_preview=self.link_preview, parse_mode=parse_mode,
            clear_draft=clear
        )
384330
function Channel_sendMessage(message) {
  if (!this._websocket) return

  message = JSON.stringify(message)
  this._websocket.send(message)
}
249908
def send(ch, message, **kwargs):
    
    params = {
        'type': kwargs.pop('req_type', 'self'),
        'key': settings.PUSHALL_API_KEYS[ch]['key'],
        'id': settings.PUSHALL_API_KEYS[ch]['id'],
        'title': kwargs.pop(
            "title", settings.PUSHALL_API_KEYS[ch].get('title') or ""),
        'text': message,
        'priority': kwargs.pop(
            "priority", settings.PUSHALL_API_KEYS[ch].get('priority') or "0"),
    }
    if kwargs:
        params.update(**kwargs)

    response = urlopen(
        Request('https://pushall.ru/api.php'),
        urlencode(params),
        timeout=10
    )

    if response.code != 200:
        raise PushAllError(response.read())

    json = loads(response.read())
    if json.get('error'):
        raise PushAllError(json.get('error'))

    return True
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
        )
991162
def send_message(message)
      response = self.class.post(@api.send_message_config[:url],
        :query => { :auth_token => @token },
        :body  => {
          :room_id => room_id,
          :message => message,
        }.send(@api.send_config[:body_format]),
        :headers => @api.headers
      )

      ErrorHandler.response_code_to_exception_for :room, room_id, response
      true
    end
527991
def send_message(self, body, to, quiet=False, html_body=None):
        """"""
        if to.get('MUTED'):
            to['QUEUED_MESSAGES'].append(body)
        else:
            if not quiet:
                logger.info('message on %s to %s: %s' % (self.name, to['JID'], body))

            message = xmpp.protocol.Message(to=to['JID'], body=body, typ='chat')
            if html_body:
                html = xmpp.Node('html', {'xmlns': 'http://jabber.org/protocol/xhtml-im'})
                html.addChild(node=xmpp.simplexml.XML2Node("<body xmlns='http://www.w3.org/1999/xhtml'>" + html_body.encode('utf-8') + "</body>"))
                message.addChild(node=html)

            self.client.send(message)
629342
def sendMessage(self, message, thread_id=None, thread_type=ThreadType.USER):
        
        return self.send(
            Message(text=message), thread_id=thread_id, thread_type=thread_type
        )
1343283
def send_chat_action(self, action, to):
        
        payload = dict(chat_id=to, action=action)
        return self._get('sendChatAction', payload)
104742
def send_message(data)
      # TODO: format
      # TODO: validation
      data = prepare_data(data)
      logger.debug { "Sending request to #{url.to_s}:\n#{data}" } if logger

      http =
        Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass).
        new(url.host, url.port)

      http.read_timeout = http_read_timeout
      http.open_timeout = http_open_timeout
      http.use_ssl      = secure

      response = begin
                   http.post(url.path, data, HEADERS)
                 rescue *HTTP_ERRORS => e
                   log :error, "Timeout while contacting the Whoops server."
                   nil
                 end

      case response
      when Net::HTTPSuccess then
        log :info, "Success: #{response.class}", response
      else
        log :error, "Failure: #{response.class}", response
      end

      if response && response.respond_to?(:body)
        error_id = response.body.match(%r{<error-id[^>]*>(.*?)</error-id>})
        error_id[1] if error_id
      end
    end
476798
def send_slack_message(message):
    """"""

    if 'SLACK_WEB_HOOK' not in os.environ:
        raise EnvironmentError("Could not find SLACK_WEB_HOOK environment variable")

    webhook = os.environ['SLACK_WEB_HOOK']

    r = requests.post(webhook, json={'text':message, 'username': 'Release Bot'})
    if r.status_code != 200:
        raise RuntimeError("Could not post message to slack channel")
542086
def chat_post_message(self, channel, text, **params):
        
        method = 'chat.postMessage'
        params.update({
            'channel': channel,
            'text': text,
        })
        return self._make_request(method, params)
1052803
function sendChat(roomId, content) {
        return retryAction(() => forum._emit('modules.chats.send', {
            roomId: roomId,
            message: content
        }), 5);
    }
549785
def send(user, message, **kwargs):
    

    headers = {
        "Content-type": "application/json",
        "Authorization": "key=" + kwargs.pop("gcm_key", settings.GCM_KEY)
    }

    hook_url = 'https://android.googleapis.com/gcm/send'

    data = {
        "registration_ids": [user],
        "data": {
            "title": kwargs.pop("event"),
            'message': message,
        }
    }
    data['data'].update(kwargs)

    up = urlparse(hook_url)
    http = HTTPSConnection(up.netloc)
    http.request(
        "POST", up.path,
        headers=headers,
        body=dumps(data))
    response = http.getresponse()

    if response.status != 200:
        raise GCMError(response.reason)

    body = response.read()
    if loads(body).get("failure") > 0:
        raise GCMError(repr(body))
    return True
78919
def _send_api_message(self, message):
        

        self.slack.chat.post_message(**message)
        self.log.debug("sent api message %r", message)