20 lines
422 B
Go
20 lines
422 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
func ParseRole(roleString string) string {
|
||
|
if !strings.HasPrefix(roleString, "<@&") || !strings.HasSuffix(roleString, ">") {
|
||
|
return ""
|
||
|
}
|
||
|
return roleString[3 : len(roleString)-1]
|
||
|
}
|
||
|
|
||
|
func ParseEmoji(emojiString string) string {
|
||
|
if !strings.HasPrefix(emojiString, "<:") || !strings.HasSuffix(emojiString, ">") {
|
||
|
return emojiString
|
||
|
}
|
||
|
return emojiString[2 : len(emojiString)-1]
|
||
|
}
|