Receive an inbound SMS and send a reply from RiveScript.
545417
def hello_rivescript():
    """"""

    from_number = request.values.get("From", "unknown")
    message     = request.values.get("Body")
    reply       = "(Internal error)"

    # Get a reply from RiveScript.
    if message:
        reply = bot.reply(from_number, message)

    # Send the response.
    resp = twilio.twiml.Response()
    resp.message(reply)
    return str(resp)
380478
def sendMessage(self,chat_id,text,parse_mode=None,disable_web=None,reply_msg_id=None,markup=None):
		'''  '''
		payload={'chat_id' : chat_id, 'text' : text, 'parse_mode': parse_mode , 'disable_web_page_preview' : disable_web , 'reply_to_message_id' : reply_msg_id}
		
		if(markup):
			payload['reply_markup']=json.dumps(markup)
			
		response_str = self._command('sendMessage',payload,method='post')
		
		return _validate_response_msg(response_str)
394142
def reply():
    
    params = request.json
    if not params:
        return jsonify({
            "status": "error",
            "error": "Request must be of the application/json type!",
        })

    username = params.get("username")
    message  = params.get("message")
    uservars = params.get("vars", dict())

    # Make sure the required params are present.
    if username is None or message is None:
        return jsonify({
            "status": "error",
            "error": "username and message are required keys",
        })

    # Copy and user vars from the post into RiveScript.
    if type(uservars) is dict:
        for key, value in uservars.items():
            bot.set_uservar(username, key, value)

    # Get a reply from the bot.
    reply = bot.reply(username, message)

    # Get all the user's vars back out of the bot to include in the response.
    uservars = bot.get_uservars(username)

    # Send the response.
    return jsonify({
        "status": "ok",
        "reply": reply,
        "vars": uservars,
    })
1172048
def _hm_send_msg(self, message):
        """"""
        try:
            serial_message = message
            self.conn.write(serial_message)   # Write a string
        except serial.SerialTimeoutException:
            serror = "Write timeout error: \n"
            sys.stderr.write(serror)
        # Now wait for reply
        byteread = self.conn.read(159)
        # NB max return is 75 in 5/2 mode or 159 in 7day mode
        datal = list(byteread)
        return datal
361092
def send(self, sender: PytgbotApiBot):
        
        return sender.send_invoice(
            # receiver, self.media, disable_notification=self.disable_notification, reply_to_message_id=reply_id
            title=self.title, description=self.description, payload=self.payload, provider_token=self.provider_token, start_parameter=self.start_parameter, currency=self.currency, prices=self.prices, chat_id=self.receiver, reply_to_message_id=self.reply_id, provider_data=self.provider_data, photo_url=self.photo_url, photo_size=self.photo_size, photo_width=self.photo_width, photo_height=self.photo_height, need_name=self.need_name, need_phone_number=self.need_phone_number, need_email=self.need_email, need_shipping_address=self.need_shipping_address, send_phone_number_to_provider=self.send_phone_number_to_provider, send_email_to_provider=self.send_email_to_provider, is_flexible=self.is_flexible, disable_notification=self.disable_notification, reply_markup=self.reply_markup
        )
457522
function getReply(req, res) {
	// Get data from the JSON post.
	var username = req.body.username;
	var message  = req.body.message;
	var vars     = req.body.vars;

	// Make sure username and message are included.
	if (typeof(username) === "undefined" || typeof(message) === "undefined") {
		return error(res, "username and message are required keys");
	}

	// Copy any user vars from the post into RiveScript.
	if (typeof(vars) !== "undefined") {
		for (var key in vars) {
			if (vars.hasOwnProperty(key)) {
				bot.setUservar(username, key, vars[key]);
			}
		}
	}

	// Get a reply from the bot.
	bot.reply(username, message, this).then(function(reply) {
		// Get all the user's vars back out of the bot to include in the response.
		vars = bot.getUservars(username);

		// Send the JSON response.
		res.json({
			"status": "ok",
			"reply": reply,
			"vars": vars
		});
	}).catch(function(err) {
		res.json({
			"status": "error",
			"error": err
		});
	});
}
1049825
public function send($destination, $text)
    {
        /** @var Response $response */
        $response = $this->browser->post('http://distext.wavy.be/api/sms', array(
            'X-Auth-Token' => $this->apiKey,
        ), json_encode([
            'destination' => $destination,
            'text' => $text,
        ]));
        
        if(!$response->isSuccessful()) {
            $message = $response->getStatusCode() === 401 ? 'Invalid API key' : $response->getReasonPhrase();
            throw new \Exception($message);
        }
    }
395373
function(params) {
                if (userInfo && params.ownerId !== userInfo.id) {
                    return sendMessage({
                        chatMessageVOType: chatMessageVOTypes.DELIVERY,
                        typeCode: params.typeCode,
                        content: params.messageId,
                        pushMsgType: 3
                    });
                }
            }
796038
def send(self, to, from_, body):
        
        try:
            msg = self.client.sms.messages.create(
                body=body,
                to=to,
                from_=from_
                )
            print msg.sid
        except twilio.TwilioRestException as e:
            raise
274470
public void sendMessage(final SMSBroker sms) {
		
		final int smsId = sms.getId();
		final String smsRecipient = sms.getRecipient();
		final String smsMessage = sms.getMessage();
		
		logger.info("Send message to smsenvoi with parameter : ");
		logger.info("   - message id : " + smsId);
		logger.info("   - message recipient : " + smsRecipient);
		logger.info("   - message : " + smsMessage);
		
		try {
			
			// only send the message if required
			if (!simulateMessageSending) {
				save_message_id(sms, realSendMessage(sms));

				logger.info("message with : " + 
						  " - id : " + smsId + "successfully sent");
			} else {
				logger.warn("Message with id : " + smsId + " not sent because simlation mode is enable");
			}

			
		} catch (Throwable t) {
			logger.error("An error occurs sending SMS : " + 
				     " - id : " + smsId + 
				     " - recipient : " + smsRecipient + 
				     " - message : " + smsMessage, t);
		}		
	}
299648
def send(self, message):
        """"""
        if isinstance(message, bytes):
            message = message.decode("utf8")

        with self.send_lock:
            try:
                self.ws.send(message)
            except socket.error:
                chat_backend.unsubscribe(self)
281301
def send_text(self, text, **options):
        
        return self.bot.send_message(self.id, text, **options)
271695
def send(self, msg):
        """"""
        assert isinstance(msg, str), "String is required"

        if self._debug:
            log.info("outgoing message: %s, %s", self.id, str(msg)[:200])

        if self.state != STATE_OPEN:
            return

        self._feed(FRAME_MESSAGE, msg)
299728
def deliver(event)
      info do
        recipients = Array(event.payload[:to]).join(', ')
        "\nSent SMS to #{recipients} (#{event.duration.round(1)}ms)"
      end

      debug { event.payload[:sms] }
    end
613731
function sendText(payload: {
  to: string,
  from: string,
  message: string,
  statusCallback: string,
}): Promise<null | TwilioResponse> {
  if (!(process.env.TWILIO_ACCOUNT_SID && process.env.TWILIO_AUTH_TOKEN)) {
    logErr(
      new Error(
        "Could not send text message, missing required Twilio env vars"
      ),
      { payload }
    );
    return Promise.resolve(null);
  } else if (!Twilio) {
    Twilio = require("twilio");
  }

  return new Twilio(
    process.env.TWILIO_ACCOUNT_SID,
    process.env.TWILIO_AUTH_TOKEN
  ).messages.create({
    to: `+1${payload.to}`,
    from: `+1${payload.from}`,
    body: payload.message,
    statusCallback: payload.statusCallback,
  });
}
126147
def send_sms(self, text, **kw):
        

        params = {
            'user': self._user,
            'pass': self._passwd,
            'msg': text
        }

        kw.setdefault("verify", False)

        if not kw["verify"]:
            # remove SSL warning
            requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

        res = requests.get(FreeClient.BASE_URL, params=params, **kw)
        return FreeResponse(res.status_code)
246029
function receivedMessageWithoutNLP(messageText, senderID, event) {
    // match a greeting intent and send a response,
    if (messageText == "hi" || messageText == "hello") {
        sendTextMessage(senderID, "Hello there.");
    }
    // match an intent to talk to a real human
    else if (messageText == "help" || messageText == "operator") {
        // let the user know that they are being routed to a human
        sendTextMessage(senderID, "Hang tight. Let me see what I can do.");
        // send a janis alert to your slack channel
        // that the user could use assistance
        janis.assistanceRequested(event);
        
    }
    // otherwise log an unknown intent with janis
    else {
        // let the user know that the bot does not understand
        sendTextMessage(senderID, "Sorry, I don't understand.");
        // capture conversational ‘dead-ends’.
        janis.logUnknownIntent(event);
    }
}