Post a message as the bot.

        :param str text: the text of the message
        :param attachments: a list of attachments
        :type attachments: :class:`list`
        :return: ``True`` if successful
        :rtype: bool
968406
def post(self, text, attachments=None):
        
        return self.manager.post(self.bot_id, text, attachments)
486089
def send(to, message, **kwargs):
    

    available_kwargs_keys = [
        'parse_mode',
        'disable_web_page_preview',
        'disable_notification',
        'reply_to_message_id',
        'reply_markup'
    ]

    available_kwargs = {
        k: v for k, v in kwargs.iteritems() if k in available_kwargs_keys
    }

    bot = telepot.Bot(settings.TELEGRAM_BOT_TOKEN)
    return bot.sendMessage(to, message, **available_kwargs)
255956
def run(self, text):
        
        for regex in self.regexes:
            text = regex.sub(self.repl, text)
        return text
1083672
def send(
            self,
            *,
            text: str,
    ) -> List[OutputRecord]:
        
        try:
            status = self.api.status_post(status=text)

            return [TootRecord(record_data={
                "toot_id": status["id"],
                "text": text
            })]

        except mastodon.MastodonError as e:
            return [self.handle_error((f"Bot {self.bot_name} encountered an error when "
                                      f"sending post {text} without media:\n{e}\n"),
                                     e)]
901334
async def _send_text(self,
                         request: Request,
                         stack: Stack,
                         parse_mode: Optional[Text] = None):
        

        parts = []
        chat_id = request.message.get_chat_id()

        for layer in stack.layers:
            if isinstance(layer, (lyr.Text, lyr.RawText, lyr.Markdown)):
                text = await render(layer.text, request)
                parts.append(text)

        for part in parts[:-1]:
            await self.call(
                'sendMessage',
                text=part,
                chat_id=chat_id,
            )

        msg = {
            'text': parts[-1],
            'chat_id': chat_id,
        }

        if parse_mode is not None:
            msg['parse_mode'] = parse_mode

        await set_reply_markup(msg, request, stack)

        if stack.has_layer(Reply):
            reply = stack.get_layer(Reply)
            if reply.message:
                msg['reply_to_message_id'] = reply.message['message_id']

        if stack.has_layer(Update):
            update = stack.get_layer(Update)

            if update.inline_message_id:
                msg['inline_message_id'] = update.inline_message_id
                del msg['chat_id']
            else:
                msg['message_id'] = update.message_id

            await self.call(
                'editMessageText',
                {'Bad Request: message is not modified'},
                **msg
            )
        else:
            await self.call('sendMessage', **msg)
792151
def send(self):
        
        log = logging.getLogger(self.cls_logger + '.send')

        if self.attachments:
            self.payload['attachments'] = self.attachments

        # Encode payload in JSON
        log.debug('Using payload: %s', self.payload)
        try:
            json_payload = json.JSONEncoder().encode(self.payload)
        except(TypeError, ValueError, OverflowError):
            _, ex, trace = sys.exc_info()
            msg = 'There was a problem encoding the JSON payload\n{e}'.format(e=str(ex))
            raise OSError, msg, trace
        else:
            log.debug('JSON payload: %s', json_payload)

        # Post to Slack!
        log.debug('Posting message to Slack...')
        try:
            result = requests.post(url=self.webhook_url, data=json_payload)
        except requests.exceptions.ConnectionError:
            _, ex, trace = sys.exc_info()
            msg = '{n}: There was a problem posting to Slack\n{e}'.format(n=ex.__class__.__name__, e=str(ex))
            raise OSError, msg, trace

        # Check return code
        if result.status_code != 200:
            log.error('Slack post to url {u} failed with code: {c}'.format(c=result.status_code, u=self.webhook_url))
        else:
            log.debug('Posted message to Slack successfully.')

        # Clear out attachments after sending
        self.attachments = []
        self.payload.pop('attachments', None)
63202
def send(self, sender: PytgbotApiBot):
        
        return sender.send_sticker(
            # receiver, self.media, disable_notification=self.disable_notification, reply_to_message_id=reply_id
            sticker=self.sticker, chat_id=self.receiver, reply_to_message_id=self.reply_id, disable_notification=self.disable_notification, reply_markup=self.reply_markup
        )
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
        )
235254
def send_keys(self, text: str = 'cerium') -> None:
        ''''''
        self.click()
        self._parent.send_keys(text)
84436
def send_ClientCutText(self, message):
        
        self.sendMessage(struct.pack("!BxxxI", 6, len(message)))
        self.sendMessage(message)
807126
def text(self,text):
        
        if text:
            text = utfstr(text)
            text = text.strip()
            text = re.sub('\s+',' ',text)
            if text:
                self.dirty = True
                self.escpos.text(text)
1365581
def append(self, message_level, message_text):
        
        if not message_level in MessagesHeader._message_levels:
            raise ValueError('message_level="%s"' % message_level)
        self._messages.append((message_level, message_text))
554748
def send(self, text):
        
        if text:
            self.send_buffer += text.replace('\n', '\r\n')
            self.send_pending = True
1267354
def action(text)
      line = text.to_s.each_line.first.chomp
      @bot.irc.send("PRIVMSG #@name :\001ACTION #{line}\001")
    end
554774
function parseEntityBotCommand(text, entity) {
    let result = RE_BOT_COMMAND.exec(text.substr(
        entity.offset,
        entity.length
    ));

    return {
        type: entity.type,
        name: result[1],
        mention: result[2],
    };
}
1333288
def report_by_text(text, inline_mode = true)
      raise "Please specify xml text." if text.empty?
      errors = parse(text)

      send_comment(errors, inline_mode)
    end
1086596
def send_text(hwnd, txt):
    
    try:
        for c in txt:
            if c == '\n':
                win32api.SendMessage(hwnd, win32con.WM_KEYDOWN, win32con.VK_RETURN, 0)
                win32api.SendMessage(hwnd, win32con.WM_KEYUP, win32con.VK_RETURN, 0)
            else:
                win32api.SendMessage(hwnd, win32con.WM_CHAR, ord(c), 0)            
    except Exception as ex:
        print('error calling SendMessage ' + str(ex))