(phone string)
| 148 | } |
| 149 | |
| 150 | func getDingTalkMobileFromPhone(phone string) (string, error) { |
| 151 | if phone == "" { |
| 152 | return "", nil |
| 153 | } |
| 154 | phoneNumber, err := phonenumbers.Parse(phone, "") |
| 155 | if err != nil { |
| 156 | return "", errors.Wrapf(err, "failed to parse phone number %q", phone) |
| 157 | } |
| 158 | if phoneNumber == nil { |
| 159 | return "", nil |
| 160 | } |
| 161 | if phoneNumber.NationalNumber == nil { |
| 162 | return "", nil |
| 163 | } |
| 164 | return strconv.FormatInt(int64(*phoneNumber.NationalNumber), 10), nil |
| 165 | } |
| 166 | |
| 167 | func sendMessage(context webhook.Context) error { |
| 168 | text := getMarkdownText(context) |
no outgoing calls