runline 0.2.1 → 0.2.2
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/dist/plugins/actionNetwork/src/index.js +118 -25
- package/dist/plugins/activeCampaign/src/index.js +184 -38
- package/dist/plugins/adalo/src/index.js +40 -8
- package/dist/plugins/affinity/src/index.js +100 -20
- package/dist/plugins/agileCrm/src/index.js +115 -27
- package/dist/plugins/airtable/src/index.js +94 -19
- package/dist/plugins/airtop/src/index.js +266 -62
- package/dist/plugins/apiTemplateIo/src/index.js +25 -5
- package/dist/plugins/asana/src/index.js +195 -41
- package/dist/plugins/autopilot/src/index.js +39 -8
- package/dist/plugins/bambooHr/src/index.js +109 -22
- package/dist/plugins/bannerbear/src/index.js +36 -8
- package/dist/plugins/baserow/src/index.js +35 -7
- package/dist/plugins/beeminder/src/index.js +198 -40
- package/dist/plugins/bitly/src/index.js +46 -10
- package/dist/plugins/bitwarden/src/index.js +167 -36
- package/dist/plugins/box/src/index.js +172 -37
- package/dist/plugins/brandfetch/src/index.js +5 -1
- package/dist/plugins/brevo/src/index.js +136 -29
- package/dist/plugins/bubble/src/index.js +76 -17
- package/dist/plugins/chargebee/src/index.js +35 -7
- package/dist/plugins/circleci/src/index.js +50 -10
- package/dist/plugins/ciscoWebex/src/index.js +131 -27
- package/dist/plugins/clearbit/src/index.js +76 -17
- package/dist/plugins/clickup/src/index.js +500 -107
- package/dist/plugins/clockify/src/index.js +229 -47
- package/dist/plugins/cloudflare/src/index.js +28 -6
- package/dist/plugins/cockpit/src/index.js +54 -12
- package/dist/plugins/coda/src/index.js +81 -19
- package/dist/plugins/coingecko/src/index.js +157 -33
- package/dist/plugins/contentful/src/index.js +85 -17
- package/dist/plugins/convertkit/src/index.js +74 -18
- package/dist/plugins/copper/src/index.js +59 -11
- package/dist/plugins/cortex/src/index.js +55 -13
- package/dist/plugins/currents/src/index.js +310 -71
- package/dist/plugins/customerIo/src/index.js +112 -23
- package/dist/plugins/databricks/src/index.js +549 -115
- package/dist/plugins/deepl/src/index.js +26 -6
- package/dist/plugins/demio/src/index.js +56 -11
- package/dist/plugins/dhl/src/index.js +16 -3
- package/dist/plugins/discord/src/index.js +141 -31
- package/dist/plugins/discourse/src/index.js +136 -31
- package/dist/plugins/disqus/src/index.js +96 -20
- package/dist/plugins/docker/src/index.js +20 -4
- package/dist/plugins/drift/src/index.js +19 -5
- package/dist/plugins/dropbox/src/index.js +139 -30
- package/dist/plugins/dropcontact/src/index.js +21 -4
- package/dist/plugins/egoi/src/index.js +61 -15
- package/dist/plugins/elasticsearch/src/index.js +59 -13
- package/dist/plugins/emelia/src/index.js +95 -19
- package/dist/plugins/erpnext/src/index.js +74 -15
- package/dist/plugins/facebookGraph/src/index.js +52 -11
- package/dist/plugins/freshdesk/src/index.js +220 -48
- package/dist/plugins/freshservice/src/index.js +39 -9
- package/dist/plugins/freshworksCrm/src/index.js +58 -12
- package/dist/plugins/getresponse/src/index.js +87 -18
- package/dist/plugins/ghost/src/index.js +114 -26
- package/dist/plugins/github/src/index.js +483 -109
- package/dist/plugins/gitlab/src/index.js +193 -45
- package/dist/plugins/gong/src/index.js +68 -14
- package/dist/plugins/gotify/src/index.js +43 -9
- package/dist/plugins/gotowebinar/src/index.js +233 -47
- package/dist/plugins/grafana/src/index.js +92 -21
- package/dist/plugins/graphql/src/index.js +38 -8
- package/dist/plugins/grist/src/index.js +52 -10
- package/dist/plugins/hackernews/src/index.js +32 -6
- package/dist/plugins/halopsa/src/index.js +131 -26
- package/dist/plugins/harvest/src/index.js +182 -42
- package/dist/plugins/helpscout/src/index.js +153 -31
- package/dist/plugins/highlevel/src/index.js +291 -58
- package/dist/plugins/homeAssistant/src/index.js +124 -26
- package/dist/plugins/hubspot/src/index.js +163 -29
- package/dist/plugins/humanticAi/src/index.js +54 -5
- package/dist/plugins/hunter/src/index.js +21 -4
- package/dist/plugins/intercom/src/index.js +95 -20
- package/dist/plugins/iterable/src/index.js +96 -20
- package/dist/plugins/jenkins/src/index.js +75 -17
- package/dist/plugins/jira/src/index.js +193 -43
- package/dist/plugins/keap/src/index.js +222 -56
- package/dist/plugins/kobotoolbox/src/index.js +113 -25
- package/dist/plugins/lemlist/src/index.js +79 -18
- package/dist/plugins/linear/src/index.js +86 -19
- package/dist/plugins/lingvanex/src/index.js +38 -8
- package/dist/plugins/linkedin/src/index.js +37 -8
- package/dist/plugins/lonescale/src/index.js +41 -9
- package/dist/plugins/magento/src/index.js +98 -27
- package/dist/plugins/mailcheck/src/index.js +11 -2
- package/dist/plugins/mailchimp/src/index.js +193 -42
- package/dist/plugins/mailerlite/src/index.js +61 -12
- package/dist/plugins/mailgun/src/index.js +39 -7
- package/dist/plugins/mailjet/src/index.js +141 -30
- package/dist/plugins/mandrill/src/index.js +67 -14
- package/dist/plugins/marketstack/src/index.js +56 -10
- package/dist/plugins/matrix/src/index.js +97 -20
- package/dist/plugins/mattermost/src/index.js +124 -26
- package/dist/plugins/mautic/src/index.js +129 -26
- package/dist/plugins/medium/src/index.js +64 -13
- package/dist/plugins/messagebird/src/index.js +80 -15
- package/dist/plugins/metabase/src/index.js +57 -12
- package/dist/plugins/misp/src/index.js +135 -33
- package/dist/plugins/mocean/src/index.js +33 -7
- package/dist/plugins/monday/src/index.js +97 -23
- package/dist/plugins/monicaCrm/src/index.js +112 -23
- package/dist/plugins/msg91/src/index.js +11 -2
- package/dist/plugins/nasa/src/index.js +108 -21
- package/dist/plugins/netlify/src/index.js +28 -6
- package/dist/plugins/netscalerAdc/src/index.js +144 -29
- package/dist/plugins/nextcloud/src/index.js +103 -20
- package/dist/plugins/nocodb/src/index.js +57 -11
- package/dist/plugins/notion/src/index.js +148 -37
- package/dist/plugins/npm/src/index.js +59 -12
- package/dist/plugins/odoo/src/index.js +102 -20
- package/dist/plugins/okta/src/index.js +50 -10
- package/dist/plugins/oneSimpleApi/src/index.js +84 -17
- package/dist/plugins/onfleet/src/index.js +139 -32
- package/dist/plugins/openThesaurus/src/index.js +46 -9
- package/dist/plugins/openweathermap/src/index.js +31 -6
- package/dist/plugins/oura/src/index.js +36 -7
- package/dist/plugins/paddle/src/index.js +80 -17
- package/dist/plugins/pagerduty/src/index.js +53 -12
- package/dist/plugins/paypal/src/index.js +51 -11
- package/dist/plugins/peekalink/src/index.js +12 -3
- package/dist/plugins/phantombuster/src/index.js +39 -8
- package/dist/plugins/philipsHue/src/index.js +64 -13
- package/dist/plugins/pipedrive/src/index.js +167 -45
- package/dist/plugins/plivo/src/index.js +43 -8
- package/dist/plugins/postbin/src/index.js +9 -2
- package/dist/plugins/posthog/src/index.js +50 -13
- package/dist/plugins/profitwell/src/index.js +24 -5
- package/dist/plugins/pushbullet/src/index.js +45 -9
- package/dist/plugins/pushcut/src/index.js +31 -6
- package/dist/plugins/pushover/src/index.js +51 -10
- package/dist/plugins/quickbase/src/index.js +66 -13
- package/dist/plugins/quickbooks/src/index.js +86 -19
- package/dist/plugins/quickchart/src/index.js +35 -7
- package/dist/plugins/raindrop/src/index.js +54 -13
- package/dist/plugins/reddit/src/index.js +73 -18
- package/dist/plugins/rocketchat/src/index.js +47 -9
- package/dist/plugins/rundeck/src/index.js +26 -5
- package/dist/plugins/salesforce/src/index.js +161 -31
- package/dist/plugins/salesmate/src/index.js +75 -16
- package/dist/plugins/securityScorecard/src/index.js +73 -15
- package/dist/plugins/segment/src/index.js +21 -4
- package/dist/plugins/sendgrid/src/index.js +102 -24
- package/dist/plugins/sendy/src/index.js +54 -11
- package/dist/plugins/sentry/src/index.js +174 -34
- package/dist/plugins/servicenow/src/index.js +120 -27
- package/dist/plugins/shopify/src/index.js +53 -12
- package/dist/plugins/signl4/src/index.js +16 -3
- package/dist/plugins/slack/src/index.js +407 -105
- package/dist/plugins/sms77/src/index.js +26 -5
- package/dist/plugins/splunk/src/index.js +186 -45
- package/dist/plugins/spotify/src/index.js +265 -66
- package/dist/plugins/stackby/src/index.js +18 -6
- package/dist/plugins/storyblok/src/index.js +57 -11
- package/dist/plugins/strapi/src/index.js +63 -12
- package/dist/plugins/strava/src/index.js +58 -13
- package/dist/plugins/stripe/src/index.js +143 -30
- package/dist/plugins/supabase/src/index.js +49 -10
- package/dist/plugins/syncromsp/src/index.js +245 -67
- package/dist/plugins/tapfiliate/src/index.js +57 -14
- package/dist/plugins/telegram/src/index.js +202 -39
- package/dist/plugins/thehive/src/index.js +271 -66
- package/dist/plugins/thehiveProject/src/index.js +457 -89
- package/dist/plugins/todoist/src/index.js +326 -77
- package/dist/plugins/travisci/src/index.js +35 -8
- package/dist/plugins/trello/src/index.js +204 -46
- package/dist/plugins/twake/src/index.js +10 -2
- package/dist/plugins/twilio/src/index.js +56 -11
- package/dist/plugins/twist/src/index.js +241 -48
- package/dist/plugins/twitter/src/index.js +128 -30
- package/dist/plugins/unleashedSoftware/src/index.js +30 -6
- package/dist/plugins/uplead/src/index.js +9 -2
- package/dist/plugins/uproc/src/index.js +31 -6
- package/dist/plugins/uptimerobot/src/index.js +119 -25
- package/dist/plugins/urlscanio/src/index.js +25 -6
- package/dist/plugins/vero/src/index.js +68 -13
- package/dist/plugins/vonage/src/index.js +32 -6
- package/dist/plugins/wekan/src/index.js +297 -52
- package/dist/plugins/woocommerce/src/index.js +57 -12
- package/dist/plugins/wordpress/src/index.js +94 -18
- package/dist/plugins/xero/src/index.js +79 -13
- package/dist/plugins/yourls/src/index.js +33 -6
- package/dist/plugins/zammad/src/index.js +139 -36
- package/dist/plugins/zendesk/src/index.js +201 -48
- package/dist/plugins/zoho/src/index.js +88 -21
- package/dist/plugins/zoom/src/index.js +41 -7
- package/dist/plugins/zulip/src/index.js +101 -20
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@ function getConn(ctx) {
|
|
|
5
5
|
}
|
|
6
6
|
async function apiRequest(conn, method, endpoint, body) {
|
|
7
7
|
const url = `${conn.baseUrl}/bot${conn.token}/${endpoint}`;
|
|
8
|
-
const init = {
|
|
8
|
+
const init = {
|
|
9
|
+
method,
|
|
10
|
+
headers: { "Content-Type": "application/json" },
|
|
11
|
+
};
|
|
9
12
|
if (body && Object.keys(body).length > 0)
|
|
10
13
|
init.body = JSON.stringify(body);
|
|
11
14
|
const res = await fetch(url, init);
|
|
@@ -20,8 +23,18 @@ export default function telegram(rl) {
|
|
|
20
23
|
rl.setName("telegram");
|
|
21
24
|
rl.setVersion("0.1.0");
|
|
22
25
|
rl.setConnectionSchema({
|
|
23
|
-
accessToken: {
|
|
24
|
-
|
|
26
|
+
accessToken: {
|
|
27
|
+
type: "string",
|
|
28
|
+
required: true,
|
|
29
|
+
description: "Telegram Bot token",
|
|
30
|
+
env: "TELEGRAM_BOT_TOKEN",
|
|
31
|
+
},
|
|
32
|
+
baseUrl: {
|
|
33
|
+
type: "string",
|
|
34
|
+
required: false,
|
|
35
|
+
description: "API base URL (default: https://api.telegram.org)",
|
|
36
|
+
env: "TELEGRAM_BASE_URL",
|
|
37
|
+
},
|
|
25
38
|
});
|
|
26
39
|
// ── Message ─────────────────────────────────────────
|
|
27
40
|
rl.registerAction("message.send", {
|
|
@@ -29,7 +42,11 @@ export default function telegram(rl) {
|
|
|
29
42
|
inputSchema: {
|
|
30
43
|
chatId: { type: "string", required: true },
|
|
31
44
|
text: { type: "string", required: true },
|
|
32
|
-
parseMode: {
|
|
45
|
+
parseMode: {
|
|
46
|
+
type: "string",
|
|
47
|
+
required: false,
|
|
48
|
+
description: "Markdown, MarkdownV2, or HTML",
|
|
49
|
+
},
|
|
33
50
|
disableWebPagePreview: { type: "boolean", required: false },
|
|
34
51
|
disableNotification: { type: "boolean", required: false },
|
|
35
52
|
replyToMessageId: { type: "number", required: false },
|
|
@@ -58,7 +75,11 @@ export default function telegram(rl) {
|
|
|
58
75
|
},
|
|
59
76
|
async execute(input, ctx) {
|
|
60
77
|
const p = input;
|
|
61
|
-
const body = {
|
|
78
|
+
const body = {
|
|
79
|
+
chat_id: p.chatId,
|
|
80
|
+
message_id: p.messageId,
|
|
81
|
+
text: p.text,
|
|
82
|
+
};
|
|
62
83
|
if (p.parseMode)
|
|
63
84
|
body.parse_mode = p.parseMode;
|
|
64
85
|
return apiRequest(getConn(ctx), "POST", "editMessageText", body);
|
|
@@ -66,18 +87,31 @@ export default function telegram(rl) {
|
|
|
66
87
|
});
|
|
67
88
|
rl.registerAction("message.delete", {
|
|
68
89
|
description: "Delete a message",
|
|
69
|
-
inputSchema: {
|
|
90
|
+
inputSchema: {
|
|
91
|
+
chatId: { type: "string", required: true },
|
|
92
|
+
messageId: { type: "number", required: true },
|
|
93
|
+
},
|
|
70
94
|
async execute(input, ctx) {
|
|
71
95
|
const p = input;
|
|
72
|
-
return apiRequest(getConn(ctx), "POST", "deleteMessage", {
|
|
96
|
+
return apiRequest(getConn(ctx), "POST", "deleteMessage", {
|
|
97
|
+
chat_id: p.chatId,
|
|
98
|
+
message_id: p.messageId,
|
|
99
|
+
});
|
|
73
100
|
},
|
|
74
101
|
});
|
|
75
102
|
rl.registerAction("message.pin", {
|
|
76
103
|
description: "Pin a message in a chat",
|
|
77
|
-
inputSchema: {
|
|
104
|
+
inputSchema: {
|
|
105
|
+
chatId: { type: "string", required: true },
|
|
106
|
+
messageId: { type: "number", required: true },
|
|
107
|
+
disableNotification: { type: "boolean", required: false },
|
|
108
|
+
},
|
|
78
109
|
async execute(input, ctx) {
|
|
79
110
|
const p = input;
|
|
80
|
-
const body = {
|
|
111
|
+
const body = {
|
|
112
|
+
chat_id: p.chatId,
|
|
113
|
+
message_id: p.messageId,
|
|
114
|
+
};
|
|
81
115
|
if (p.disableNotification)
|
|
82
116
|
body.disable_notification = true;
|
|
83
117
|
return apiRequest(getConn(ctx), "POST", "pinChatMessage", body);
|
|
@@ -85,34 +119,69 @@ export default function telegram(rl) {
|
|
|
85
119
|
});
|
|
86
120
|
rl.registerAction("message.unpin", {
|
|
87
121
|
description: "Unpin a message in a chat",
|
|
88
|
-
inputSchema: {
|
|
122
|
+
inputSchema: {
|
|
123
|
+
chatId: { type: "string", required: true },
|
|
124
|
+
messageId: { type: "number", required: true },
|
|
125
|
+
},
|
|
89
126
|
async execute(input, ctx) {
|
|
90
127
|
const p = input;
|
|
91
|
-
return apiRequest(getConn(ctx), "POST", "unpinChatMessage", {
|
|
128
|
+
return apiRequest(getConn(ctx), "POST", "unpinChatMessage", {
|
|
129
|
+
chat_id: p.chatId,
|
|
130
|
+
message_id: p.messageId,
|
|
131
|
+
});
|
|
92
132
|
},
|
|
93
133
|
});
|
|
94
134
|
rl.registerAction("message.sendLocation", {
|
|
95
135
|
description: "Send a location",
|
|
96
|
-
inputSchema: {
|
|
136
|
+
inputSchema: {
|
|
137
|
+
chatId: { type: "string", required: true },
|
|
138
|
+
latitude: { type: "number", required: true },
|
|
139
|
+
longitude: { type: "number", required: true },
|
|
140
|
+
},
|
|
97
141
|
async execute(input, ctx) {
|
|
98
142
|
const p = input;
|
|
99
|
-
return apiRequest(getConn(ctx), "POST", "sendLocation", {
|
|
143
|
+
return apiRequest(getConn(ctx), "POST", "sendLocation", {
|
|
144
|
+
chat_id: p.chatId,
|
|
145
|
+
latitude: p.latitude,
|
|
146
|
+
longitude: p.longitude,
|
|
147
|
+
});
|
|
100
148
|
},
|
|
101
149
|
});
|
|
102
150
|
rl.registerAction("message.sendChatAction", {
|
|
103
151
|
description: "Send a chat action (typing, upload_photo, etc.)",
|
|
104
|
-
inputSchema: {
|
|
152
|
+
inputSchema: {
|
|
153
|
+
chatId: { type: "string", required: true },
|
|
154
|
+
action: {
|
|
155
|
+
type: "string",
|
|
156
|
+
required: true,
|
|
157
|
+
description: "typing, upload_photo, record_video, etc.",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
105
160
|
async execute(input, ctx) {
|
|
106
161
|
const p = input;
|
|
107
|
-
return apiRequest(getConn(ctx), "POST", "sendChatAction", {
|
|
162
|
+
return apiRequest(getConn(ctx), "POST", "sendChatAction", {
|
|
163
|
+
chat_id: p.chatId,
|
|
164
|
+
action: p.action,
|
|
165
|
+
});
|
|
108
166
|
},
|
|
109
167
|
});
|
|
110
168
|
rl.registerAction("message.sendPhoto", {
|
|
111
169
|
description: "Send a photo by URL",
|
|
112
|
-
inputSchema: {
|
|
170
|
+
inputSchema: {
|
|
171
|
+
chatId: { type: "string", required: true },
|
|
172
|
+
photo: {
|
|
173
|
+
type: "string",
|
|
174
|
+
required: true,
|
|
175
|
+
description: "Photo URL or file_id",
|
|
176
|
+
},
|
|
177
|
+
caption: { type: "string", required: false },
|
|
178
|
+
},
|
|
113
179
|
async execute(input, ctx) {
|
|
114
180
|
const p = input;
|
|
115
|
-
const body = {
|
|
181
|
+
const body = {
|
|
182
|
+
chat_id: p.chatId,
|
|
183
|
+
photo: p.photo,
|
|
184
|
+
};
|
|
116
185
|
if (p.caption)
|
|
117
186
|
body.caption = p.caption;
|
|
118
187
|
return apiRequest(getConn(ctx), "POST", "sendPhoto", body);
|
|
@@ -120,10 +189,21 @@ export default function telegram(rl) {
|
|
|
120
189
|
});
|
|
121
190
|
rl.registerAction("message.sendDocument", {
|
|
122
191
|
description: "Send a document by URL",
|
|
123
|
-
inputSchema: {
|
|
192
|
+
inputSchema: {
|
|
193
|
+
chatId: { type: "string", required: true },
|
|
194
|
+
document: {
|
|
195
|
+
type: "string",
|
|
196
|
+
required: true,
|
|
197
|
+
description: "Document URL or file_id",
|
|
198
|
+
},
|
|
199
|
+
caption: { type: "string", required: false },
|
|
200
|
+
},
|
|
124
201
|
async execute(input, ctx) {
|
|
125
202
|
const p = input;
|
|
126
|
-
const body = {
|
|
203
|
+
const body = {
|
|
204
|
+
chat_id: p.chatId,
|
|
205
|
+
document: p.document,
|
|
206
|
+
};
|
|
127
207
|
if (p.caption)
|
|
128
208
|
body.caption = p.caption;
|
|
129
209
|
return apiRequest(getConn(ctx), "POST", "sendDocument", body);
|
|
@@ -131,10 +211,21 @@ export default function telegram(rl) {
|
|
|
131
211
|
});
|
|
132
212
|
rl.registerAction("message.sendVideo", {
|
|
133
213
|
description: "Send a video by URL",
|
|
134
|
-
inputSchema: {
|
|
214
|
+
inputSchema: {
|
|
215
|
+
chatId: { type: "string", required: true },
|
|
216
|
+
video: {
|
|
217
|
+
type: "string",
|
|
218
|
+
required: true,
|
|
219
|
+
description: "Video URL or file_id",
|
|
220
|
+
},
|
|
221
|
+
caption: { type: "string", required: false },
|
|
222
|
+
},
|
|
135
223
|
async execute(input, ctx) {
|
|
136
224
|
const p = input;
|
|
137
|
-
const body = {
|
|
225
|
+
const body = {
|
|
226
|
+
chat_id: p.chatId,
|
|
227
|
+
video: p.video,
|
|
228
|
+
};
|
|
138
229
|
if (p.caption)
|
|
139
230
|
body.caption = p.caption;
|
|
140
231
|
return apiRequest(getConn(ctx), "POST", "sendVideo", body);
|
|
@@ -142,18 +233,39 @@ export default function telegram(rl) {
|
|
|
142
233
|
});
|
|
143
234
|
rl.registerAction("message.sendSticker", {
|
|
144
235
|
description: "Send a sticker",
|
|
145
|
-
inputSchema: {
|
|
236
|
+
inputSchema: {
|
|
237
|
+
chatId: { type: "string", required: true },
|
|
238
|
+
sticker: {
|
|
239
|
+
type: "string",
|
|
240
|
+
required: true,
|
|
241
|
+
description: "Sticker URL or file_id",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
146
244
|
async execute(input, ctx) {
|
|
147
245
|
const p = input;
|
|
148
|
-
return apiRequest(getConn(ctx), "POST", "sendSticker", {
|
|
246
|
+
return apiRequest(getConn(ctx), "POST", "sendSticker", {
|
|
247
|
+
chat_id: p.chatId,
|
|
248
|
+
sticker: p.sticker,
|
|
249
|
+
});
|
|
149
250
|
},
|
|
150
251
|
});
|
|
151
252
|
rl.registerAction("message.sendAnimation", {
|
|
152
253
|
description: "Send a GIF/animation",
|
|
153
|
-
inputSchema: {
|
|
254
|
+
inputSchema: {
|
|
255
|
+
chatId: { type: "string", required: true },
|
|
256
|
+
animation: {
|
|
257
|
+
type: "string",
|
|
258
|
+
required: true,
|
|
259
|
+
description: "Animation URL or file_id",
|
|
260
|
+
},
|
|
261
|
+
caption: { type: "string", required: false },
|
|
262
|
+
},
|
|
154
263
|
async execute(input, ctx) {
|
|
155
264
|
const p = input;
|
|
156
|
-
const body = {
|
|
265
|
+
const body = {
|
|
266
|
+
chat_id: p.chatId,
|
|
267
|
+
animation: p.animation,
|
|
268
|
+
};
|
|
157
269
|
if (p.caption)
|
|
158
270
|
body.caption = p.caption;
|
|
159
271
|
return apiRequest(getConn(ctx), "POST", "sendAnimation", body);
|
|
@@ -161,10 +273,21 @@ export default function telegram(rl) {
|
|
|
161
273
|
});
|
|
162
274
|
rl.registerAction("message.sendAudio", {
|
|
163
275
|
description: "Send audio by URL",
|
|
164
|
-
inputSchema: {
|
|
276
|
+
inputSchema: {
|
|
277
|
+
chatId: { type: "string", required: true },
|
|
278
|
+
audio: {
|
|
279
|
+
type: "string",
|
|
280
|
+
required: true,
|
|
281
|
+
description: "Audio URL or file_id",
|
|
282
|
+
},
|
|
283
|
+
caption: { type: "string", required: false },
|
|
284
|
+
},
|
|
165
285
|
async execute(input, ctx) {
|
|
166
286
|
const p = input;
|
|
167
|
-
const body = {
|
|
287
|
+
const body = {
|
|
288
|
+
chat_id: p.chatId,
|
|
289
|
+
audio: p.audio,
|
|
290
|
+
};
|
|
168
291
|
if (p.caption)
|
|
169
292
|
body.caption = p.caption;
|
|
170
293
|
return apiRequest(getConn(ctx), "POST", "sendAudio", body);
|
|
@@ -174,49 +297,85 @@ export default function telegram(rl) {
|
|
|
174
297
|
rl.registerAction("chat.get", {
|
|
175
298
|
description: "Get chat info",
|
|
176
299
|
inputSchema: { chatId: { type: "string", required: true } },
|
|
177
|
-
async execute(input, ctx) {
|
|
300
|
+
async execute(input, ctx) {
|
|
301
|
+
return apiRequest(getConn(ctx), "POST", "getChat", {
|
|
302
|
+
chat_id: input.chatId,
|
|
303
|
+
});
|
|
304
|
+
},
|
|
178
305
|
});
|
|
179
306
|
rl.registerAction("chat.getAdministrators", {
|
|
180
307
|
description: "Get chat administrators",
|
|
181
308
|
inputSchema: { chatId: { type: "string", required: true } },
|
|
182
|
-
async execute(input, ctx) {
|
|
309
|
+
async execute(input, ctx) {
|
|
310
|
+
return apiRequest(getConn(ctx), "POST", "getChatAdministrators", {
|
|
311
|
+
chat_id: input.chatId,
|
|
312
|
+
});
|
|
313
|
+
},
|
|
183
314
|
});
|
|
184
315
|
rl.registerAction("chat.getMember", {
|
|
185
316
|
description: "Get a chat member",
|
|
186
|
-
inputSchema: {
|
|
317
|
+
inputSchema: {
|
|
318
|
+
chatId: { type: "string", required: true },
|
|
319
|
+
userId: { type: "number", required: true },
|
|
320
|
+
},
|
|
187
321
|
async execute(input, ctx) {
|
|
188
322
|
const p = input;
|
|
189
|
-
return apiRequest(getConn(ctx), "POST", "getChatMember", {
|
|
323
|
+
return apiRequest(getConn(ctx), "POST", "getChatMember", {
|
|
324
|
+
chat_id: p.chatId,
|
|
325
|
+
user_id: p.userId,
|
|
326
|
+
});
|
|
190
327
|
},
|
|
191
328
|
});
|
|
192
329
|
rl.registerAction("chat.leave", {
|
|
193
330
|
description: "Leave a chat",
|
|
194
331
|
inputSchema: { chatId: { type: "string", required: true } },
|
|
195
|
-
async execute(input, ctx) {
|
|
332
|
+
async execute(input, ctx) {
|
|
333
|
+
return apiRequest(getConn(ctx), "POST", "leaveChat", {
|
|
334
|
+
chat_id: input.chatId,
|
|
335
|
+
});
|
|
336
|
+
},
|
|
196
337
|
});
|
|
197
338
|
rl.registerAction("chat.setDescription", {
|
|
198
339
|
description: "Set chat description",
|
|
199
|
-
inputSchema: {
|
|
340
|
+
inputSchema: {
|
|
341
|
+
chatId: { type: "string", required: true },
|
|
342
|
+
description: { type: "string", required: true },
|
|
343
|
+
},
|
|
200
344
|
async execute(input, ctx) {
|
|
201
345
|
const p = input;
|
|
202
|
-
return apiRequest(getConn(ctx), "POST", "setChatDescription", {
|
|
346
|
+
return apiRequest(getConn(ctx), "POST", "setChatDescription", {
|
|
347
|
+
chat_id: p.chatId,
|
|
348
|
+
description: p.description,
|
|
349
|
+
});
|
|
203
350
|
},
|
|
204
351
|
});
|
|
205
352
|
rl.registerAction("chat.setTitle", {
|
|
206
353
|
description: "Set chat title",
|
|
207
|
-
inputSchema: {
|
|
354
|
+
inputSchema: {
|
|
355
|
+
chatId: { type: "string", required: true },
|
|
356
|
+
title: { type: "string", required: true },
|
|
357
|
+
},
|
|
208
358
|
async execute(input, ctx) {
|
|
209
359
|
const p = input;
|
|
210
|
-
return apiRequest(getConn(ctx), "POST", "setChatTitle", {
|
|
360
|
+
return apiRequest(getConn(ctx), "POST", "setChatTitle", {
|
|
361
|
+
chat_id: p.chatId,
|
|
362
|
+
title: p.title,
|
|
363
|
+
});
|
|
211
364
|
},
|
|
212
365
|
});
|
|
213
366
|
// ── Callback ────────────────────────────────────────
|
|
214
367
|
rl.registerAction("callback.answer", {
|
|
215
368
|
description: "Answer a callback query",
|
|
216
|
-
inputSchema: {
|
|
369
|
+
inputSchema: {
|
|
370
|
+
callbackQueryId: { type: "string", required: true },
|
|
371
|
+
text: { type: "string", required: false },
|
|
372
|
+
showAlert: { type: "boolean", required: false },
|
|
373
|
+
},
|
|
217
374
|
async execute(input, ctx) {
|
|
218
375
|
const p = input;
|
|
219
|
-
const body = {
|
|
376
|
+
const body = {
|
|
377
|
+
callback_query_id: p.callbackQueryId,
|
|
378
|
+
};
|
|
220
379
|
if (p.text)
|
|
221
380
|
body.text = p.text;
|
|
222
381
|
if (p.showAlert)
|
|
@@ -228,6 +387,10 @@ export default function telegram(rl) {
|
|
|
228
387
|
rl.registerAction("file.get", {
|
|
229
388
|
description: "Get file metadata (use result.file_path to download)",
|
|
230
389
|
inputSchema: { fileId: { type: "string", required: true } },
|
|
231
|
-
async execute(input, ctx) {
|
|
390
|
+
async execute(input, ctx) {
|
|
391
|
+
return apiRequest(getConn(ctx), "POST", "getFile", {
|
|
392
|
+
file_id: input.fileId,
|
|
393
|
+
});
|
|
394
|
+
},
|
|
232
395
|
});
|
|
233
396
|
}
|