@pipedream/telegram_bot_api 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/actions/create-chat-invite-link/create-chat-invite-link.mjs +52 -0
- package/actions/delete-message/delete-message.mjs +29 -0
- package/actions/edit-media-message/edit-media-message.mjs +89 -0
- package/actions/edit-text-message/edit-text-message.mjs +45 -0
- package/actions/export-chat-invite-link/export-chat-invite-link.mjs +23 -0
- package/actions/forward-message/forward-message.mjs +48 -0
- package/actions/get-num-members-in-chat/get-num-members-in-chat.mjs +23 -0
- package/actions/kick-chat-member/kick-chat-member.mjs +38 -0
- package/actions/list-administrators-in-chat/list-administrators-in-chat.mjs +25 -0
- package/actions/list-chats/list-chats.mjs +73 -0
- package/actions/list-updates/list-updates.mjs +49 -0
- package/actions/pin-message/pin-message.mjs +37 -0
- package/actions/promote-chat-member/promote-chat-member.mjs +86 -0
- package/actions/restrict-chat-member/restrict-chat-member.mjs +66 -0
- package/actions/send-album/send-album.mjs +53 -0
- package/actions/send-audio-file/send-audio-file.mjs +98 -0
- package/actions/send-document-or-image/send-document-or-image.mjs +83 -0
- package/actions/send-media-by-url-or-id/send-media-by-url-or-id.mjs +73 -0
- package/actions/send-photo/send-photo.mjs +84 -0
- package/actions/send-sticker/send-sticker.mjs +53 -0
- package/actions/send-text-message-or-reply/send-text-message-or-reply.mjs +66 -0
- package/actions/send-video/send-video.mjs +86 -0
- package/actions/send-video-note/send-video-note.mjs +76 -0
- package/actions/send-voice-message/send-voice-message.mjs +85 -0
- package/actions/unpin-message/unpin-message.mjs +29 -0
- package/constants.mjs +198 -0
- package/content-types.mjs +115 -0
- package/env.mjs +14 -0
- package/package.json +21 -0
- package/sources/channel-updates/channel-updates.mjs +50 -0
- package/sources/message-updates/message-updates.mjs +50 -0
- package/sources/new-updates/new-updates.mjs +63 -0
- package/telegram_bot_api.app.mjs +682 -0
- package/update-types.mjs +50 -0
- package/utils.mjs +27 -0
package/update-types.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on the Telegram Bot API docs for the getUpdates endpoint.
|
|
3
|
+
* {@see {@link https://core.telegram.org/bots/api#update Telegram Bot API Update object}}
|
|
4
|
+
*/
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
label: "Message",
|
|
8
|
+
value: "message",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: "Edited Message",
|
|
12
|
+
value: "edited_message",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "Channel Post",
|
|
16
|
+
value: "channel_post",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Edited Channel Post",
|
|
20
|
+
value: "edited_channel_post",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Inline Query",
|
|
24
|
+
value: "inline_query",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Chosen Inline Result",
|
|
28
|
+
value: "chosen_inline_result",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Callback Query",
|
|
32
|
+
value: "callback_query",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "Shipping Query",
|
|
36
|
+
value: "shipping_query",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "Pre Checkout Query",
|
|
40
|
+
value: "pre_checkout_query",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "Poll",
|
|
44
|
+
value: "poll",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "Poll Answer",
|
|
48
|
+
value: "poll_answer",
|
|
49
|
+
},
|
|
50
|
+
];
|
package/utils.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Taken from {@linkcode ../aws/sources/common/utils.mjs utils.mjs}.
|
|
3
|
+
* A utility function that accepts a string as an argument and reformats it in
|
|
4
|
+
* order to remove newline characters and consecutive spaces. Useful when
|
|
5
|
+
* dealing with very long templated strings that are split into multiple lines.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // returns "This is a much cleaner string"
|
|
9
|
+
* toSingleLineString(`
|
|
10
|
+
* This is a much
|
|
11
|
+
* cleaner string
|
|
12
|
+
* `);
|
|
13
|
+
*
|
|
14
|
+
* @param {string} multiLineString the input string to reformat
|
|
15
|
+
* @returns a formatted string based on the content of the input argument,
|
|
16
|
+
* without newlines and multiple spaces
|
|
17
|
+
*/
|
|
18
|
+
function toSingleLineString(multiLineString) {
|
|
19
|
+
return multiLineString
|
|
20
|
+
.trim()
|
|
21
|
+
.replace(/\n/g, " ")
|
|
22
|
+
.replace(/\s{2,}/g, " ");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
toSingleLineString,
|
|
27
|
+
};
|