utils

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidChannelID added in v1.2.0

func IsValidChannelID(channelID string) bool

func IsValidGuildID added in v1.2.0

func IsValidGuildID(guildID string) bool

func NormalizeInput added in v1.2.0

func NormalizeInput(input string) string

func RespondToInteraction

func RespondToInteraction(s *discordgo.Session, i *discordgo.InteractionCreate, message string, ephemeral bool)

func RespondWithEmbed

func RespondWithEmbed(s *discordgo.Session, i *discordgo.InteractionCreate, embed *discordgo.MessageEmbed, ephemeral bool)

func SanitizeAnnouncement

func SanitizeAnnouncement(input string) string

func SanitizeInput

func SanitizeInput(input string) string

func SendFollowupMessage

func SendFollowupMessage(s *discordgo.Session, i *discordgo.InteractionCreate, message string, ephemeral bool)

func TruncateString added in v1.2.0

func TruncateString(s string, maxLength int) string

func UpdateMessageWithEmbed

func UpdateMessageWithEmbed(s *discordgo.Session, i *discordgo.InteractionCreate, embed *discordgo.MessageEmbed)

func ValidateAPIKey added in v1.2.0

func ValidateAPIKey(apiKey string, provider string) error

func ValidateAccountTitle added in v1.2.0

func ValidateAccountTitle(title string) error

func ValidateActivisionID added in v1.2.0

func ValidateActivisionID(id string) error

func ValidateCaptchaProvider added in v1.2.0

func ValidateCaptchaProvider(provider string) (string, error)

func ValidateCheckInterval added in v1.2.0

func ValidateCheckInterval(interval int) error

func ValidateDiscordUserID added in v1.2.0

func ValidateDiscordUserID(userID string) error

func ValidateEmbed added in v1.2.0

func ValidateEmbed(embed *discordgo.MessageEmbed) error

func ValidateEmbedField added in v1.2.0

func ValidateEmbedField(field *discordgo.MessageEmbedField) error

func ValidateMessage added in v1.2.0

func ValidateMessage(content string) error

func ValidateNotificationInterval added in v1.2.0

func ValidateNotificationInterval(interval float64) error

func ValidateNotificationType added in v1.2.0

func ValidateNotificationType(notificationType string) (string, error)

func ValidateTimeRange added in v1.2.0

func ValidateTimeRange(start, end time.Time) error

func WithTransaction

func WithTransaction(db *gorm.DB, fn func(*gorm.DB) error) error

Types

type ValidationError added in v1.2.0

type ValidationError struct {
	Field   string
	Message string
}

func (ValidationError) Error added in v1.2.0

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL