twilioapi.py 524 B

1234567891011121314151617181920
  1. # pylint: disable=invalid-name
  2. # pylint: disable=unused-variable
  3. '''
  4. Twilioapi.py is responsible for sending
  5. a message from a registered Twilio number
  6. to a user's phone.
  7. '''
  8. from twilio.rest import TwilioRestClient
  9. account_sid = "AC7889a1889c1833bd7181e45e60372776"
  10. auth_token = "1ad0315f3cc7a154aaaef048f1304f71"
  11. client = TwilioRestClient(account_sid, auth_token)
  12. def sendSMS(body, to, sender):
  13. '''Sends a message to a given number'''
  14. message = client.messages.create(body=body, to=to, from_=sender)
  15. return