Documentation ¶
Index ¶
- Constants
- func Contains[T comparable](array []T, value T) bool
- func ErrorAsEmbed(message string) *discordgo.MessageEmbed
- func Filter[T any](array []T, predicate func(T) bool) []T
- func GetLatestMessageFromUser(s *discordgo.Session, u *discordgo.User, c *discordgo.Channel) (*discordgo.Message, error)
- func GetMemberRoles(s *discordgo.Session, guildId string, member *discordgo.Member) ([]*discordgo.Role, error)
- func GetMessagesFromUser(s *discordgo.Session, u *discordgo.User, c *discordgo.Channel, limit uint) ([]*discordgo.Message, error)
- func GetRoleById(s *discordgo.Session, guildId string, id string) (*discordgo.Role, error)
- func GetRoleByName(s *discordgo.Session, guildId string, name string) (*discordgo.Role, error)
- func HasRole(s *discordgo.Session, member *discordgo.Member, role *discordgo.Role) bool
- func IfElse[T any](condition bool, a, b T) T
- func InArray[T comparable](array []T, value T) bool
- func InfoAsEmbed(description string) *discordgo.MessageEmbed
- func IntPtr[T int64](i T) *T
- func Map[T any, U any](array []T, mapper func(T) U) []U
- func MessagesMatch(current *discordgo.MessageSend, sent *discordgo.Message) bool
- func NewDiscordLogHandler(s *discordgo.Session, guildId, channelId string) log.Handler
- func Pluralize(count int, singular, plural string) string
- func Remove[T comparable](array []T, value T) ([]T, error)
- func RemoveFromArray[T comparable](array []T, value T) ([]T, error)
- func SuccessAsEmbed(description string) *discordgo.MessageEmbed
- func UpdateMessage(session *discordgo.Session, current *discordgo.MessageSend, ...) error
Constants ¶
const ( ColorPrimary = 0xB4DDB4 ColorSuccess = 0x00FF00 ColorError = 0xFF0000 ColorWarning = 0xFFFF00 ColorInfo = 0x0000FF ColorNeutral = 0x808080 )
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](array []T, value T) bool
Contains returns true if `array` contains `value`
func ErrorAsEmbed ¶
func ErrorAsEmbed(message string) *discordgo.MessageEmbed
func Filter ¶
Filter returns a new array containing only the elements of `array` for which `predicate` returns true
func GetMemberRoles ¶
func GetMemberRoles(s *discordgo.Session, guildId string, member *discordgo.Member) ([]*discordgo.Role, error)
GetMemberRoles returns the roles of the member in the given guild
func GetMessagesFromUser ¶
func GetRoleById ¶
GetRoleById returns the role with the given id or an error if it doesn't exist
func GetRoleByName ¶
GetRoleById returns the role with the given name or an error if it doesn't exist
func IfElse ¶
IfElse is a function that returns `a` if `condition` is true, otherwise it returns `b`
func InArray ¶
func InArray[T comparable](array []T, value T) bool
func InfoAsEmbed ¶
func InfoAsEmbed(description string) *discordgo.MessageEmbed
func Map ¶
Map returns a new array containing the results of applying `mapper` to each element of `array`
func MessagesMatch ¶
func MessagesMatch(current *discordgo.MessageSend, sent *discordgo.Message) bool
func NewDiscordLogHandler ¶
func Remove ¶
func Remove[T comparable](array []T, value T) ([]T, error)
Remove removes the first instance of `value` from `array`
func RemoveFromArray ¶
func RemoveFromArray[T comparable](array []T, value T) ([]T, error)
func SuccessAsEmbed ¶
func SuccessAsEmbed(description string) *discordgo.MessageEmbed
func UpdateMessage ¶
func UpdateMessage(session *discordgo.Session, current *discordgo.MessageSend, sent *discordgo.Message) error
UpdateMessages compares the current version of a message to the version that was sent and updates it if they are different
Types ¶
This section is empty.