Queries a chat message object.

        :Parameters:
          Id : int
            Message Id.

        :return: A chat message object.
        :rtype: `ChatMessage`
973852
def Message(self, Id=0):
        
        o = ChatMessage(self, Id)
        o.Status # Test if such an id is known.
        return o
899447
def process_chat(self, chat: types.Chat):
        
        if not chat:
            return

        yield 'chat_id', chat.id
        yield 'chat_type', chat.type
        if self.include_content:
            yield 'chat_title', chat.full_name
            if chat.username:
                yield 'chat_name', f"@{chat.username}"
313109
async def get_reply_message(self):
        
        if self._reply_message is None:
            if not self.reply_to_msg_id:
                return None

            # Bots cannot access other bots' messages by their ID.
            # However they can access them through replies...
            self._reply_message = await self._client.get_messages(
                await self.get_input_chat() if self.is_channel else None,
                ids=types.InputMessageReplyTo(self.id)
            )
            if not self._reply_message:
                # ...unless the current message got deleted.
                #
                # If that's the case, give it a second chance accessing
                # directly by its ID.
                self._reply_message = await self._client.get_messages(
                    self._input_chat if self.is_channel else None,
                    ids=self.reply_to_msg_id
                )

        return self._reply_message
817578
def per_callback_query_chat_id(types='all'):
    
    def f(msg):
        if (flavor(msg) == 'callback_query' and 'message' in msg
            and (types == 'all' or msg['message']['chat']['type'] in types)):
            return msg['message']['chat']['id']
        else:
            return None
    return f
431843
def post_chat_message(self, merchant_id, channel_id, message):
        

        return self.do_req('POST',
                           self.base_url + '/chat/v1/merchant/%s/channel/%s/message/' % (merchant_id, channel_id),
                           message)
1309500
def conversations(self):
        
        body = {
            "conversation_type": self.conversation_type,
            "audience_definition": self.audience_definition,
            "targeting_inputs": self.targeting_inputs
        }
        return self.__get(account=self.account, client=self.account.client, params=json.dumps(body))
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))
155313
def send(self, chat_id, msg_type, **kwargs):
        
        data = {
            'chatid': chat_id,
            'safe': kwargs.get('safe') or 0
        }
        data.update(self._build_msg_content(msg_type, **kwargs))

        return self._post('appchat/send', data=data)
503062
function(conversationId, params, callback) {
      conversationId = utils.toUUID(conversationId);
      if (!conversationId) return callback(new Error(utils.i18n.messages.cid));
      utils.debug('Message getAll: ' + conversationId);

      var queryParams = '';
      if (typeof params === 'function') callback = params;
      else queryParams = '?' + querystring.stringify(params);

      request.get({
        path: '/conversations/' + conversationId + '/messages' + queryParams
      }, callback);
    }
1351346
def conversations(self, max_id=None, min_id=None, since_id=None, limit=None):
        
        if max_id != None:
            max_id = self.__unpack_id(max_id)
        
        if min_id != None:
            min_id = self.__unpack_id(min_id)
            
        if since_id != None:
            since_id = self.__unpack_id(since_id)            
        
        params = self.__generate_params(locals())
        return self.__api_request('GET', "/api/v1/conversations/", params)
448870
def gotMessage(self, message_id, message):
        
        d = defer.maybeDeferred(self._handle_message, message)
        d.addCallback(self.generate_response)
        d.addCallback(lambda resp: self.reply(message_id, resp))
        return d
425643
def defines(self, id, domain='messages'):
        
        assert isinstance(id, (str, unicode))
        assert isinstance(domain, (str, unicode))

        return id in self.messages.get(domain, {})
745179
def message(self, message: types.Message):
        
        setattr(self, 'from_chat_id', message.chat.id)
        setattr(self, 'message_id', message.message_id)
        return self
1045319
async def update_chat(self):
        
        other = await self.bot.get_chat(self.id)

        for key, value in other:
            self[key] = value
138199
def get_chat_administrators(self, chat_id):
        
        result = apihelper.get_chat_administrators(self.token, chat_id)
        ret = []
        for r in result:
            ret.append(types.ChatMember.de_json(r))
        return ret
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,
        )
650459
def forward_message(self, chat_id, from_chat_id, message_id):
        
        self.logger.info('forwarding message %s from %s to %s', message_id, from_chat_id, chat_id)
        payload = dict(chat_id=chat_id,
                       from_chat_id=from_chat_id,
                       message_id=message_id)
        return Message.from_api(self, **self._get('forwardMessage', payload))