Create a ``Chat`` object from a message.

        :param Bot bot: ``Bot`` object the message and chat belong to
        :param dict message: Message to base the object on
        :return: A chat object based on the message
778229
def from_message(bot, message):
        
        chat = message["chat"]
        return Chat(bot, chat["id"], chat["type"], message)
1015446
def create_message(data)
      message = Discordrb::Message.new(data, self)
      return message if message.from_bot? && !@should_parse_self
      return message if message.webhook? && !@attributes[:webhook_commands]

      unless message.author
        Discordrb::LOGGER.warn("Received a message (#{message.inspect}) with nil author! Ignoring, please report this if you can")
        return
      end

      event = CommandEvent.new(message, self)

      chain = trigger?(message)
      return message unless chain

      # Don't allow spaces between the prefix and the command
      if chain.start_with?(' ') && !@attributes[:spaces_allowed]
        debug('Chain starts with a space')
        return message
      end

      if chain.strip.empty?
        debug('Chain is empty')
        return message
      end

      execute_chain(chain, event)

      # Return the message so it doesn't get parsed again during the rest of the dispatch handling
      message
    end
1367189
def from_array(array):
        
        if array is None or not array:
            return None
        # end if
        assert_type_or_raise(array, dict, parameter_name="array")

        data = {}
        data['action'] = u(array.get('action'))
        if array.get('chat_id') is None:
            data['receiver'] = None
        elif isinstance(array.get('chat_id'), None):
            data['receiver'] = None(array.get('chat_id'))
        elif isinstance(array.get('chat_id'), str):
            data['receiver'] = u(array.get('chat_id'))
        elif isinstance(array.get('chat_id'), int):
            data['receiver'] = int(array.get('chat_id'))
        else:
            raise TypeError('Unknown type, must be one of None, str, int or None.')
        # end if
        return ChatActionMessage(**data)
1067074
def chat_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/chats"
        return self.call(api_path, method="POST", data=data, **kwargs)
619270
def from_mime(cls, message, manager):
        
        text, html, attachments = deconstruct_multipart(message)
        subject = prepare_header(message["Subject"])
        sender = prepare_header(message["From"])
        to = prepare_header(message["To"])
        cc = prepare_header(message["Cc"])
        bcc = prepare_header(message["Bcc"])
        reply_to = prepare_header(message["Reply-To"])
        tag = getattr(message, "tag", None)
        return cls(
            manager=manager,
            From=sender,
            To=to,
            TextBody=text,
            HtmlBody=html,
            Subject=subject,
            Cc=cc,
            Bcc=bcc,
            ReplyTo=reply_to,
            Attachments=attachments,
            Tag=tag,
        )
837608
def delete_message(self, chat_id, message_id):
        
        return apihelper.delete_message(self.token, chat_id, message_id)
991762
async def message_from_token(self, token: Text, payload: Any) \
            -> Tuple[Optional[BaseMessage], Optional[Platform]]:
        

        async for platform in self.get_all_platforms():
            m = await platform.message_from_token(token, payload)

            if m:
                return m, platform

        return None, None
1103694
def fromMessage(klass, message, op_endpoint=UNUSED):
        
        self = klass.__new__(klass)
        self.message = message
        self.namespace = message.getOpenIDNamespace()
        self.assoc_handle = message.getArg(OPENID_NS, 'assoc_handle')
        self.sig = message.getArg(OPENID_NS, 'sig')

        if (self.assoc_handle is None or
            self.sig is None):
            fmt = "%s request missing required parameter from message %s"
            raise ProtocolError(
                message, text=fmt % (self.mode, message))

        self.invalidate_handle = message.getArg(OPENID_NS, 'invalidate_handle')

        self.signed = message.copy()
        # openid.mode is currently check_authentication because
        # that's the mode of this request.  But the signature
        # was made on something with a different openid.mode.
        # http://article.gmane.org/gmane.comp.web.openid.general/537
        if self.signed.hasKey(OPENID_NS, "mode"):
            self.signed.setArg(OPENID_NS, "mode", "id_res")

        return self
720581
def from_Message(cls, kmsg):
        
        return cls(
            uuid=kmsg.uuid, params=kmsg.params, result=kmsg.result,
            metadata=kmsg.metadata
        )
1246606
def message(message, title=''):
    
    return backend_api.opendialog("message", dict(message=message, title=title))
1284235
def from_raw_message(cls, rawmessage):
        """"""
        if (rawmessage[5] &
                MESSAGE_FLAG_EXTENDED_0X10) == MESSAGE_FLAG_EXTENDED_0X10:
            if len(rawmessage) >= ExtendedSend.receivedSize:
                msg = ExtendedSend.from_raw_message(rawmessage)
            else:
                msg = None
        else:
            msg = StandardSend(rawmessage[2:5],
                               {'cmd1': rawmessage[6],
                                'cmd2': rawmessage[7]},
                               flags=rawmessage[5],
                               acknak=rawmessage[8:9])
        return msg
117121
def get(self, request, bot_id, format=None):
        
        return super(MessengerChatStateList, self).get(request, bot_id, format)
398300
def forward_message(self, from_chat_id, message_id):
        
        return self.bot.api_call(
            "forwardMessage",
            chat_id=self.id,
            from_chat_id=from_chat_id,
            message_id=message_id,
        )
93564
def load_message(message_id)
      response = API::Channel.message(@bot.token, @id, message_id)
      Message.new(JSON.parse(response), @bot)
    rescue RestClient::ResourceNotFound
      nil
    end
777785
def _bot_identifier(self, message):
        

        text = message['text']

        formatters = [
            lambda identifier: "%s " % identifier,
            lambda identifier: "%s:" % identifier,
        ]
        my_identifiers = [formatter(identifier) for identifier in [self.name, self.my_mention] for formatter in formatters]

        for identifier in my_identifiers:
            if text.startswith(identifier):
                self.log.debug("sent to me:\n%s", pprint.pformat(message))
                return identifier

        return None
219446
def _process_inbox_message(self, message: praw.models.Message):
        
        self._func_message(message, *self._func_message_args)
1045319
async def update_chat(self):
        
        other = await self.bot.get_chat(self.id)

        for key, value in other:
            self[key] = value