package sms

import (
	"src.rybka.ca/pkg/twilio"
	"src.rybka.ca/pkg/util"
)

type Client struct {
	TwilioClient     *twilio.Client
	RelayPhoneNumber string
}

func (c *Client) Send(to, msg string) error {
	to = util.StripNonDigits(to)
	if len(msg) > 112 {
		panic("msg too large")
	}
	return c.TwilioClient.SendSMS(c.RelayPhoneNumber, to+msg)
}
