MCPcopy
hub / github.com/42wim/matterbridge / splitURL

Method splitURL

bridge/discord/helpers.go:223–234  ·  view source on GitHub ↗

splitURL splits a webhookURL and returns the ID and token.

(url string)

Source from the content-addressed store, hash-verified

221
222// splitURL splits a webhookURL and returns the ID and token.
223func (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
236func enumerateUsernames(s string) []string {
237 onlySpace := true

Callers 1

ConnectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected