MCPcopy Create free account
hub / github.com/bytebase/bytebase / getDingTalkMobileFromPhone

Function getDingTalkMobileFromPhone

backend/plugin/webhook/dingtalk/dingtalk.go:150–165  ·  view source on GitHub ↗
(phone string)

Source from the content-addressed store, hash-verified

148}
149
150func 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
167func sendMessage(context webhook.Context) error {
168 text := getMarkdownText(context)

Callers 3

ValidateFunction · 0.85

Calls

no outgoing calls