:reference: https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/get-message
            :allowed_param:'id', 'full_text'
357110
def get_direct_message(self):
        
        return bind_api(
            api=self,
            path='/direct_messages/show/{id}.json',
            payload_type='direct_message',
            allowed_param=['id', 'full_text'],
            require_auth=True
        )
281301
def send_text(self, text, **options):
        
        return self.bot.send_message(self.id, text, **options)
1154813
def direct_reply(self, text):
        
        channel_id = self._client.open_dm_channel(self._get_user_id())
        self._client.rtm_send_message(channel_id, text)
485797
def get_user(self, id):
        
        try:
            return User(self._client.get_user(user_id=id)._json)
        except TweepError as e:
            if e.api_code == TWITTER_USER_NOT_FOUND_ERROR:
                return None
            raise
1169957
def get(self, request, bot_id, id, format=None):
                
        return super(HookDetail, self).get(request, bot_id, id, format)
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)
1339545
def retweets(self, tweet_id):
        
        log.info("retrieving retweets of %s", tweet_id)
        url = "https://api.twitter.com/1.1/statuses/retweets/""{}.json".format(
                tweet_id)

        resp = self.get(url, params={"count": 100})
        for tweet in resp.json():
            yield tweet
869937
public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.directmessage.ShowDirectMessage [message id]");
            System.exit(-1);
        }
        Twitter twitter = new TwitterFactory().getInstance();
        try {
            DirectMessage message = twitter.showDirectMessage(Long.parseLong(args[0]));
            System.out.println("From: id:" + message.getId() + " - "
                    + message.getText());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get message: " + te.getMessage());
            System.exit(-1);
        }
    }
191007
def reply(tweet_text, options = {})
      return if $bot.nil? or $bot[:client].nil?
      opts = {
        reply_all: false
      }.merge(options)

      mentions = self.mentioned_users(opts[:reply_all])

      result = "@#{mentions.join(" @")} #{tweet_text}"[(0...140)]

      $bot[:client].update result, in_reply_to_status_id: self.id
    rescue Twitter::Error => e
      puts "caught Twitter error while replying: #{e.message}"
    end
813100
function(messageId, conversationId, callback) {
      if (!messageId) return callback(new Error(utils.i18n.messages.mid));
      messageId = utils.toUUID(messageId);
      if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
      conversationId = utils.toUUID(conversationId);
      utils.debug('Message get: ' + messageId + ', ' + conversationId);
      request.get({
        path: '/conversations/' + conversationId + '/messages/' + messageId
      }, callback);
    }
784269
def send_direct_message(self, text, user=None, delegate=None, screen_name=None, user_id=None, params={}):
        
        params = params.copy()
        if user is not None:
            params['user'] = user
        if user_id is not None:
            params['user_id'] = user_id
        if screen_name is not None:
            params['screen_name'] = screen_name
        params['text'] = text
        parser = txml.Direct(delegate)
        return self.__postPage('/direct_messages/new.xml', parser, params)
1021747
def get_message(self, message_id):
        

        for message in self.messages:
            if message.id == message_id:
                return message

        raise ArgumentError("Message ID not found", message_id=message_id)
809326
def _message_from_token(self, token: Text, payload: Any) \
            -> Optional[BaseMessage]:
        

        try:
            tk = jwt.decode(token, settings.WEBVIEW_SECRET_KEY)
        except jwt.InvalidTokenError:
            return

        try:
            user_id = tk['fb_psid']
            assert isinstance(user_id, Text)
            page_id = tk['fb_pid']
            assert isinstance(page_id, Text)
        except (KeyError, AssertionError):
            return

        if self.settings()['page_id'] == page_id:
            return self._make_fake_message(user_id, page_id, payload)
394991
def get(self, request, bot_id, hook_id, id, format=None):
        
        bot = self.get_bot(bot_id, request.user)
        hook = self.get_hook(hook_id, bot, request.user)
        recipient = self.get_recipient(id, hook, request.user)
        serializer = self.serializer(recipient)
        return Response(serializer.data)
636057
def fetch_plaintext(self, msg_nums):
        
        if not msg_nums:
            raise Exception("Invalid Message Number!")

        return self.__imap_fetch_content_type(msg_nums, self.PLAIN)
605130
public static DirectMessage createDirectMessage(String rawJSON) throws TwitterException {
        try {
            return new DirectMessageJSONImpl(new JSONObject(rawJSON));
        } catch (JSONException e) {
            throw new TwitterException(e);
        }
    }
395373
function(params) {
                if (userInfo && params.ownerId !== userInfo.id) {
                    return sendMessage({
                        chatMessageVOType: chatMessageVOTypes.DELIVERY,
                        typeCode: params.typeCode,
                        content: params.messageId,
                        pushMsgType: 3
                    });
                }
            }