Posts a msg to this room's chat. Set me=True if you want to /me
977938
def post_chat(self, msg, is_me=False, is_a=False):
        """"""

        if len(msg) > self.config.max_message:
            raise ValueError(
                f"Chat message must be at most {self.config.max_message} characters."
            )
        while not self.user.nick:
            with ARBITRATOR.condition:
                ARBITRATOR.condition.wait()
        if is_a:
            if not self.admin and not self.staff:
                raise RuntimeError("Can't modchat if you're not a mod or trusted")
            self.conn.make_call("command", self.user.nick, "a", msg)
            return
        if is_me:
            self.conn.make_call("command", self.user.nick, "me", msg)
            return

        self.conn.make_call("chat", self.user.nick, msg)
1247972
def post_message(driver, message, msg_dur, style="info"):
    
    if not msg_dur:
        msg_dur = settings.DEFAULT_MESSAGE_DURATION
    msg_dur = float(msg_dur)
    message = re.escape(message)
    message = escape_quotes_if_needed(message)
    messenger_script = ('''Messenger().post({message: "%s", type: "%s", '''
                        '''hideAfter: %s, hideOnNavigate: true});'''
                        % (message, style, msg_dur))
    try:
        driver.execute_script(messenger_script)
    except Exception:
        activate_messenger(driver)
        set_messenger_theme(driver)
        try:
            driver.execute_script(messenger_script)
        except Exception:
            time.sleep(0.2)
            activate_messenger(driver)
            time.sleep(0.2)
            set_messenger_theme(driver)
            time.sleep(0.5)
            driver.execute_script(messenger_script)
691327
async def sendPoll(self, chat_id, question, options,
                       disable_notification=None,
                       reply_to_message_id=None,
                       reply_markup=None):
        
        p = _strip(locals())
        return await self._api_request('sendPoll', _rectify(p))
452326
def send_message(self, chat_id, text, **options):
        
        return self.api_call("sendMessage", chat_id=chat_id, text=text, **options)
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)
1263251
def mass_inform(self, msg):
        
        assert (msg.mtype == Message.INFORM)
        self._server.mass_send_message_from_thread(msg)
212259
async def on_message(message):
    

    # Simplify message info
    server = message.server
    author = message.author
    channel = message.channel
    content = message.content

    data = datatools.get_data()

    if not data["discord"]["servers"][server.id][_data.modulename]["activated"]:
        return

    # Only reply to server messages and don't reply to myself
    if server is not None and author != channel.server.me:
        # Commands section
        prefix = data["discord"]["servers"][server.id]["prefix"]
        if content.startswith(prefix):
            # Parse message
            package = content.split(" ")
            command = package[0][len(prefix):]

            # Commands
            if command == 'gamedeals':
                await client.send_typing(channel)

                # Get posts from Reddit API
                posts = api_reddit.get_top10()

                if posts:
                    for post in posts:
                        # Create embed UI
                        embed = ui_embed.success(channel, post)
                        await embed.send()
                else:
                    embed = ui_embed.no_results(channel)
                    await embed.send()
579726
def send(self, msg):
        """"""
        if self._req_ctx is not None:
            self._send(msg)
        else:
            self._send_queue.put(msg)
            self._event.set()
235064
def send_message(msg, type = 'TextMessage')
      connect do |http|
        request = http_request(:post, "/room/#{room_id}/speak.json")
        request.body = { :message => { :body => msg, :type => type } }.to_json
        response = http.request(request)

        case response
        when Net::HTTPCreated
          true
        else
          raise ConnectionError,
            "Error sending message '#{msg}' (#{response.class})"
        end
      end
    end
821019
def post_message(self, channel, text, **kwargs):
        
        if not channel.startswith('#'):
            channel = '#' + channel
        self.params.update({
            'channel': channel,
            'text':    text,
            })
        if kwargs:
            self.params.update(kwargs)
        return FromUrl('https://slack.com/api/chat.postMessage', self._requests)(data=self.params).post()
919947
def announce(self, msg):
        
        self.print_if_verbose("{} -> {}".format(self.network_uid, msg.__class__.__name__))
        self.__trigger_event__(
            event_class=self.MessageAnnounced,
            msg=msg,
        )
481619
function(msg) {
        if (onSendLogging)
          asyncLogger("Send", msg);

        switch (protocol) {
          case 'websocket':
            if (socketState === socketStateType.OPEN) {
              socket.emit(msg);
            } else {
              pushSendDataQueue.push(msg);
            }
            break;

          case 'queue':
            if (socketState === socketStateType.OPEN) {
              activemq.sendMessage({
                destination: params.queueSend,
                message: msg
              });
            } else {
              pushSendDataQueue.push(msg);
            }
            break;
        }
      }
399478
def send_chat_action(self, *args, **kwargs):
        """"""
        return send_chat_action(*args, **self._merge_overrides(**kwargs)).run()
725320
def _sendMessage(self, msg):
        
        if not msg:
            return
        msg = self._collapseMsg(msg)
        self.sendStatus(msg)
391799
def on_msg(msg)

      puts(fancy_print(msg, @noisy)) if @noisy

      return if msg['action'] == 'noop'

      @mutex.synchronize do

        @seen << msg
        @log << msg

        while @log.size > @log_max; @log.shift; end
        while @seen.size > @log_max; @seen.shift; end
      end
    end
377141
def reply_with_message(self, rep_msg):
        
        self._post_reply()
        return self.client_connection.reply(rep_msg, self.msg)
831040
def message(self, body, room_id, style='text'):
        '''  '''
        # TODO Automatically detect body format ?
        path = 'rooms/message'
        data = {
            'room_id': room_id,
            'message': body,
            'from': self.name,
            'notify': 1,
            'message_format': style,
            'color': self.bg_color
        }
        log.info('sending message to hipchat', message=body, room=room_id)
        feedback = self._api_call(path, data, requests.post)
        log.debug(feedback)
        return feedback