utils

package
v0.0.0-...-797257d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GITHUB  = "https://github.com/CorentinGS/Kafejo-Bot"
	VERSION = "v0.1.0"
	GREEN   = 0x00ff00
	RED     = 0xff0000
	BLUE    = 0x0000ff
	ORANGE  = 0xffa500
	PURPLE  = 0x800080

	SQLMaxOpenConns    = 50
	SQLMaxIdleConns    = 10
	CacheExpireMinutes = 2
)
View Source
const (
	ConfigRoleAdmin         = "1059086726565462136"
	ConfigRoleMod           = "1059086750921801749"
	ConfigOwnerID           = "282233191916634113"
	ConfigMainRole          = "1059086753425805354"
	ConfigGuildID           = "560798438099255296"
	ConfigGateKeepChannelID = "1059086776368631878"
	ConfigLogsChannelID     = "960577800589434950"
	ConfigWelcomeChannelID  = "1059086801203105863"
	ConfigAdminChannelID    = "1059086820442382348"
	ConfigWelcomeMessageID  = "1060225318453002351"
)

Variables

View Source
var (
	ErrConversion = errors.New("error while converting")
	ErrOpenDB     = errors.New("error while opening db")
	ErrGetDB      = errors.New("error while getting db")
	ErrGetKarma   = errors.New("error while getting karma")
)

Functions

func CreateLogger

func CreateLogger()

func FormatTimeSince

func FormatTimeSince(old time.Time) string

func GetGuildID

func GetGuildID() discord.GuildID

func GetRoleDifference

func GetRoleDifference(newRoles, oldRoles []discord.RoleID) discord.RoleID

func GetSession

func GetSession() *state.State

func HasAdminPermission

func HasAdminPermission(member *discord.Member) bool

HasAdminPermission checks if the user has admin permission

func HasModPermission

func HasModPermission(member *discord.Member) bool

HasModPermission checks if the user has mod permission

func HasOwnerPermission

func HasOwnerPermission(member discord.UserID) bool

HasOwnerPermission checks if the user has owner permission

func IsAdminOrMod

func IsAdminOrMod(member *discord.Member) bool

IsAdminOrMod checks if the user is an admin or a moderator

func IsDefaultAvatar

func IsDefaultAvatar(avatar string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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