Edits history of script submission #1058 for ' Make a Phone Call (twilio)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { Twilio } from "twilio";
    
    type Twilio = {
      accountSid: string;
      token: string;
    };
    
    export async function main(
      twilio: Twilio,
      fromPhoneNumber: string,
      toPhoneNumber: string,
      text: string
    ) {
      const client = new Twilio(twilio.accountSid, twilio.token);
    
      const call = await client.calls.create({
        url:
          "http://twimlets.com/echo?Twiml=<Response><Say>" +
          encodeURIComponent(text) +
          "</Say></Response>",
        to: toPhoneNumber,
        from: fromPhoneNumber,
      });
    
      return call;
    }
    

    Submitted by hugo697 398 days ago

  • bun
    import { Twilio } from "twilio";
    
    type Twilio = {
      accountSid: string;
      token: string;
    };
    
    export async function main(
      twilio: Twilio,
      fromPhoneNumber: string,
      toPhoneNumber: string,
      text: string
    ) {
      const client = new Twilio(twilio.accountSid, twilio.token);
    
      const call = await client.calls.create({
        url:
          "http://twimlets.com/echo?Twiml=<Response><Say>" +
          encodeURIComponent(text) +
          "</Say></Response>",
        to: toPhoneNumber,
        from: fromPhoneNumber,
      });
    
      return call;
    }
    

    Submitted by hugo697 974 days ago