Skip to content

Commit d432953

Browse files
committed
feat: update sendMessageFunction to use more descriptive parameter names for Twilio integration
1 parent cfd0d1d commit d432953

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

actions/twilio-action/src/functions/sendMessageFunction.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import { sendMessage } from "../helpers.js";
1414
import { TwilioMessage } from "../data_types/twilioMessage.js";
1515

1616
@Identifier("sendMessage")
17-
@DisplayIcon("simple:twilio")
18-
@Signature("(To: string, Body: string, From?: string, MediaUrl?: string): TWILIO_MESSAGE")
17+
@DisplayIcon("tabler:message")
18+
@Signature("(ToPhoneNumber: string, Body: string, FromPhoneNumber?: string, MediaUrl?: string): TWILIO_MESSAGE")
1919
@Name({ code: "en-US", content: "Send message" })
20-
@DisplayMessage({ code: "en-US", content: "Send message to ${To}" })
20+
@DisplayMessage({ code: "en-US", content: "Send message to ${ToPhoneNumber}" })
2121
@Documentation({
2222
code: "en-US",
2323
content:
@@ -28,7 +28,7 @@ import { TwilioMessage } from "../data_types/twilioMessage.js";
2828
content: "Sends an SMS, MMS, or channel message through the Twilio Messages API.",
2929
})
3030
@Parameter({
31-
runtimeName: "To",
31+
runtimeName: "ToPhoneNumber",
3232
name: [{ code: "en-US", content: "To" }],
3333
description: [
3434
{ code: "en-US", content: "The destination phone number in E.164 format or channel address (e.g. whatsapp:+1...)." },
@@ -40,7 +40,7 @@ import { TwilioMessage } from "../data_types/twilioMessage.js";
4040
description: [{ code: "en-US", content: "The text of the message to send. Up to 1600 characters." }],
4141
})
4242
@Parameter({
43-
runtimeName: "From",
43+
runtimeName: "FromPhoneNumber",
4444
name: [{ code: "en-US", content: "From" }],
4545
description: [
4646
{
@@ -60,13 +60,13 @@ import { TwilioMessage } from "../data_types/twilioMessage.js";
6060
export class SendMessageFunction {
6161
async run(
6262
context: FunctionContext,
63-
To: string,
63+
ToPhoneNumber: string,
6464
Body: string,
65-
From?: string,
65+
FromPhoneNumber?: string,
6666
MediaUrl?: string
6767
): Promise<TwilioMessage> {
6868
try {
69-
return await sendMessage({ To, Body, From, MediaUrl }, context);
69+
return await sendMessage({ To: ToPhoneNumber, Body, From: FromPhoneNumber, MediaUrl }, context);
7070
} catch (error) {
7171
if (error instanceof RuntimeError) {
7272
throw error;

actions/twilio-action/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const action = new Action(
88
process.env.ACTION_ID ?? "twilio-action",
99
process.env.VERSION ?? "1.0.0",
1010
process.env.AQUILA_URL ?? "127.0.0.1:8081",
11-
"code0-tech",
12-
"simple:twilio",
11+
"CodeZero",
12+
"tabler:message",
1313
"Twilio integration: send SMS, MMS, and channel messages (e.g. WhatsApp) via the Twilio Messages API.",
14-
[{ code: "en-US", content: "Twilio Action" }],
14+
[{ code: "en-US", content: "Twilio" }],
1515
[
1616
{
1717
identifier: "account_sid",

0 commit comments

Comments
 (0)