helper

package
v0.0.0-...-6ce8065 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApprovalWords = []string{
	"enabled",
	"on",
	"true",
	"yes",
	"sure",
}
View Source
var DisapprovalWords = []string{
	"disabled",
	"off",
	"false",
	"no",
	"nope",
}

Functions

func CheckIfStructValueISEmpty

func CheckIfStructValueISEmpty(value interface{}) string

CheckIfStructValueISEmpty Checks if the value is empty and returns it as string if not. Otherwise, return 'N/A'

func CreateImgFile

func CreateImgFile(imgPath string, img image.Image) error

func GetErrorEmbed

func GetErrorEmbed(err error, s *discordgo.Session, gID string) *discordgo.MessageEmbed

func GetImgbbUploadURL

func GetImgbbUploadURL(cfg *config.Configs, imgPath string, expireSecs ...int) (string, error)

func GetRandomStringFromSet

func GetRandomStringFromSet(set []string) string

func IsLaunchedByDebugger

func IsLaunchedByDebugger() bool

IsLaunchedByDebugger Determines if application is being run by the debugger.

func LogErrorsToErrorChannel

func LogErrorsToErrorChannel(s *discordgo.Session, errorLogChannelID string, err error, guildID string)

LogErrorsToErrorChannel logs any errors to console and send to the Error Discord Channel

func MemberHasRole

func MemberHasRole(session *discordgo.Session, m *discordgo.Member, guildID string, roleName string) bool

func RangeIn

func RangeIn(low, hi int) int

RangeIn Returns pseudo rand num between low and high. For random embed color: RangeIn(1, 16777215)

func SendResponseErrorToUser

func SendResponseErrorToUser(s *discordgo.Session, i *discordgo.InteractionCreate, message string) error

func StringInSlice

func StringInSlice(s string, slice []string) bool

func ToConvertedText

func ToConvertedText(text string, convertGroup string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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