splitURL splits a webhookURL and returns the ID and token.
(url string)
| 221 | |
| 222 | // splitURL splits a webhookURL and returns the ID and token. |
| 223 | func (b *Bdiscord) splitURL(url string) (string, string, bool) { |
| 224 | const ( |
| 225 | expectedWebhookSplitCount = 7 |
| 226 | webhookIdxID = 5 |
| 227 | webhookIdxToken = 6 |
| 228 | ) |
| 229 | webhookURLSplit := strings.Split(url, "/") |
| 230 | if len(webhookURLSplit) != expectedWebhookSplitCount { |
| 231 | return "", "", false |
| 232 | } |
| 233 | return webhookURLSplit[webhookIdxID], webhookURLSplit[webhookIdxToken], true |
| 234 | } |
| 235 | |
| 236 | func enumerateUsernames(s string) []string { |
| 237 | onlySpace := true |