.. include:: strings.rst Direct messages =============== .. module:: direct_messages .. function:: new(server_url, *args, **kwargs) Sends a new direct message to the specified user from the authenticating user. |post| Implements https://twitter-api.readthedocs.io/en/latest/direct-messages.html#post--api-direct_messages-new.json :param str server_url: |server_url| :rtype: dict :return: :ref:`dm_dict` .. function:: sent(server_url, *args, **kwargs) Returns the 20 most recent direct messages sent by the authenticating user. You can request up to 200 direct messages per call, and only the most recent 200 DMs will be available using this endpoint. |get| Implements https://twitter-api.readthedocs.io/en/latest/direct-messages.html#get--api-direct_messages-sent.json :param str server_url: |server_url| :rtype: list :return: a list of :ref:`direct message dicts ` .. function:: received(server_url, *args, **kwargs) Returns the 20 most recent direct messages sent to the authenticating user. You can request up to 200 direct messages per call, and only the most recent 200 DMs will be available using this endpoint. |get| Implements https://twitter-api.readthedocs.io/en/latest/direct-messages.html#get--api-direct_messages.json :param str server_url: |server_url| :rtype: list :return: a list of :ref:`direct message dicts `