Documentation
¶
Index ¶
- Constants
- func CountMentions(content string) map[string]int
- func EscapeMarkdown(text string) string
- func HasExcessiveMentions(content string, threshold int) bool
- func IsValidChannelMention(mention string) (string, bool)
- func IsValidChannelName(name string) error
- func IsValidEmoji(emoji string) (name string, id string, animated bool, valid bool)
- func IsValidInviteCode(text string) (string, bool)
- func IsValidNickname(nickname string) error
- func IsValidRoleMention(mention string) (string, bool)
- func IsValidRoleName(name string) error
- func IsValidSnowflake(id string) bool
- func IsValidUserMention(mention string) (string, bool)
- func IsValidUsername(username string) error
- func IsValidWebhookURL(url string) (id string, valid bool)
- func ParseChannelIDFromMention(mention string) (string, error)
- func ParseRoleIDFromMention(mention string) (string, error)
- func ParseUserIDFromMention(mention string) (string, error)
- func SplitMessage(content string, maxLength int) []string
- func StripMentions(content string) string
- func TruncateMessage(content string, maxLength int) string
- func ValidateEmbedAuthor(name string) error
- func ValidateEmbedDescription(description string) error
- func ValidateEmbedFieldName(name string) error
- func ValidateEmbedFieldValue(value string) error
- func ValidateEmbedFooter(text string) error
- func ValidateEmbedTitle(title string) error
- func ValidateMessageContent(content string) error
Constants ¶
View Source
const ( MaxMessageLength = 2000 MaxEmbedLength = 6000 MaxEmbedTitleLength = 256 MaxEmbedDescLength = 4096 MaxEmbedFieldCount = 25 MaxEmbedFieldName = 256 MaxEmbedFieldValue = 1024 MaxEmbedAuthorLength = 256 MaxAttachmentSize = 8388608 // 8MB for normal users MaxAttachmentSizeBoost = 104857600 // 100MB for boosted servers )
Variables ¶
This section is empty.
Functions ¶
func CountMentions ¶
func EscapeMarkdown ¶
func HasExcessiveMentions ¶
func IsValidChannelMention ¶
func IsValidChannelName ¶
func IsValidEmoji ¶
func IsValidInviteCode ¶
func IsValidNickname ¶
func IsValidRoleMention ¶
func IsValidRoleName ¶
func IsValidSnowflake ¶
func IsValidUserMention ¶
func IsValidUsername ¶
func IsValidWebhookURL ¶
func ParseRoleIDFromMention ¶
func ParseUserIDFromMention ¶
func SplitMessage ¶
func StripMentions ¶
func TruncateMessage ¶
func ValidateEmbedAuthor ¶
func ValidateEmbedFieldName ¶
func ValidateEmbedFieldValue ¶
func ValidateEmbedFooter ¶
func ValidateEmbedTitle ¶
func ValidateMessageContent ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.