Repository navigation
Add sim_number to send_sms #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,15 +95,23 @@ const sendSmsShape = { | |
| 'textbee choose. Pass it only when the user asks for a specific phone. Ids come ' + | ||
| 'from list_devices.', | ||
| ), | ||
| sim_number: z | ||
| .number() | ||
| .int() | ||
| .min(1) | ||
| .max(8) | ||
| .optional() | ||
| .describe( | ||
| "Which SIM sends the message: 1 for SIM 1, 2 for SIM 2. Omit to use the phone's default SIM.", | ||
| ), | ||
| sim_subscription_id: z | ||
| .number() | ||
| .int() | ||
| .min(0) | ||
| .optional() | ||
| .describe( | ||
| 'Which SIM sends on a dual-SIM phone. The server does not validate this: a wrong ' + | ||
| 'value is silently ignored and the phone default SIM is used. The id is shown in ' + | ||
| 'the textbee Android app.', | ||
| 'Older option. The Android id of a SIM. It can change after a SIM swap, and a wrong ' + | ||
| 'value is silently ignored. Prefer sim_number. If both are given, only sim_number is used.', | ||
| ), | ||
| scheduled_at: z | ||
| .string() | ||
|
|
@@ -214,6 +222,7 @@ export function buildToolDefinitions(opts: BuildOptions): TextbeeToolDefinition[ | |
| message: string | ||
| recipients: string[] | ||
| device_id?: string | ||
| sim_number?: number | ||
| sim_subscription_id?: number | ||
| scheduled_at?: string | ||
| } | ||
|
|
@@ -261,9 +270,11 @@ export function buildToolDefinitions(opts: BuildOptions): TextbeeToolDefinition[ | |
| message: input.message, | ||
| recipients, | ||
| ...(deviceId !== undefined ? { deviceId } : {}), | ||
| ...(input.sim_subscription_id !== undefined | ||
| ? { simSubscriptionId: input.sim_subscription_id } | ||
| : {}), | ||
| ...(input.sim_number !== undefined | ||
| ? { simSlotIndex: input.sim_number - 1 } | ||
|
Comment on lines
+273
to
+274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use an SDK that forwards The resolved
|
||
| : input.sim_subscription_id !== undefined | ||
| ? { simSubscriptionId: input.sim_subscription_id } | ||
| : {}), | ||
| ...(input.scheduled_at !== undefined ? { scheduledAt: input.scheduled_at } : {}), | ||
| }) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify when the default SIM is used.
If
sim_numberis absent, a suppliedsim_subscription_idis still forwarded and can select another SIM. State that the phone uses its default SIM when neither selector is supplied. Update README.md Line 80 as well.