|
| 1 | +Message |
| 2 | +======= |
| 3 | + |
| 4 | +This object represents a Telegram message. |
| 5 | + |
| 6 | +.. note:: |
| 7 | + |
| 8 | + This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#message>`_. |
| 9 | + |
| 10 | +==================== |
| 11 | +Message(object, bot) |
| 12 | +==================== |
| 13 | + |
| 14 | +.. warning:: |
| 15 | + |
| 16 | + This constructor should be for internal use only. |
| 17 | + |
| 18 | +Creates a new Message object. |
| 19 | + |
| 20 | +==================== |
| 21 | +reply(text, options) |
| 22 | +==================== |
| 23 | + |
| 24 | +* ``text`` <String> |
| 25 | +* ``options`` <Object> *Optional* |
| 26 | + |
| 27 | +Replies to the message and returns a promise that resolves to a :doc:`Message` object representing what has been sent. |
| 28 | + |
| 29 | +========================= |
| 30 | +forward(chat_id, options) |
| 31 | +========================= |
| 32 | + |
| 33 | +* ``chat_id`` <String>|<Chat>|<User> |
| 34 | +* ``options`` <Object> *Optional* |
| 35 | + |
| 36 | +Forwards the message to the specified chat and returns a promise that resolves to a :doc:`Message` object representing |
| 37 | +what has been sent. |
| 38 | + |
| 39 | +================================== |
| 40 | +editText = (text, inline, options) |
| 41 | +================================== |
| 42 | + |
| 43 | +* ``text`` <String> |
| 44 | +* ``inline`` <Boolean> Is the message an inline one? |
| 45 | +* ``options`` <Object> *Optional* |
| 46 | + |
| 47 | +Updates the the specified message in the specified chat and returns a promise that resolves to a :doc:`Message` object |
| 48 | +representing the updated message. True is returned by the promise if the message is an inline one. |
| 49 | + |
| 50 | +======================================== |
| 51 | +editCaption = (caption, inline, options) |
| 52 | +======================================== |
| 53 | + |
| 54 | +* ``caption`` <String> |
| 55 | +* ``inline`` <Boolean> Is the message an inline one? |
| 56 | +* ``options`` <Object> *Optional* |
| 57 | + |
| 58 | +Updates the the specified message caption in the specified chat and returns a promise that resolves to a :doc:`Message` |
| 59 | +object representing the updated message. True is returned by the promise if the message is an inline one. |
| 60 | + |
| 61 | +=========================================== |
| 62 | +editReplyMarkup = (markup, inline, options) |
| 63 | +=========================================== |
| 64 | + |
| 65 | +* ``markup`` <Keyboard> |
| 66 | +* ``inline`` <Boolean> Is the message an inline one? |
| 67 | +* ``options`` <Object> *Optional* |
| 68 | + |
| 69 | +Updates the the specified message markup in the specified chat and returns a promise that resolves to a :doc:`Message` |
| 70 | +object representing the updated message. True is returned by the promise if the message is an inline one. |
| 71 | + |
| 72 | +======== |
| 73 | +commands |
| 74 | +======== |
| 75 | +<Array> Array of objects, each one representing a command in the message. |
| 76 | + |
| 77 | +.. code-block:: javascript |
| 78 | +
|
| 79 | + // Recipient is undefined if it's a direct command |
| 80 | + {command: '/echo', recipient: 'yourbot', args: ['Many', 'things']} |
| 81 | +
|
| 82 | +======== |
| 83 | +mentions |
| 84 | +======== |
| 85 | + |
| 86 | +<Array> Array of strings, each one representing a mention (e.g. @nickname) in the message. |
| 87 | + |
| 88 | +======== |
| 89 | +hashtags |
| 90 | +======== |
| 91 | + |
| 92 | +<Array> Array of strings, each one representing an hashtag (e.g. #things) in the message. |
| 93 | + |
| 94 | +===== |
| 95 | +links |
| 96 | +===== |
| 97 | + |
| 98 | +<Array> Array of objects, each one representing a link (both URL and parsed text links) in the message. |
| 99 | + |
| 100 | +.. code-block:: javascript |
| 101 | +
|
| 102 | + // URL |
| 103 | + {type: 'url', url: 'http://google.com', text: 'http://google.it'} |
| 104 | +
|
| 105 | + // Text link |
| 106 | + {type: 'link', url: 'http://google.com', text: 'Google'} |
| 107 | +
|
| 108 | +============= |
| 109 | +text_mentions |
| 110 | +============= |
| 111 | + |
| 112 | +<Array> Array of objects, each one representing a text mention (i.e. mentions of users without a nickname) in the |
| 113 | +message. |
| 114 | + |
| 115 | +.. code-block:: javascript |
| 116 | +
|
| 117 | + {text: 'User', user: <User>} |
| 118 | +
|
| 119 | +===== |
| 120 | +photo |
| 121 | +===== |
| 122 | + |
| 123 | +<Array> Array of :doc:`PhotoSize` objects. |
| 124 | + |
| 125 | +============== |
| 126 | +new_chat_photo |
| 127 | +============== |
| 128 | + |
| 129 | +<Array> Array of :doc:`PhotoSize` objects. |
0 commit comments