Documentation ¶
Index ¶
- Constants
- Variables
- func AStringContains(a []string, b string) bool
- func ComesFromDM(s *discordgo.Session, id string) (bool, error)
- func FetchGuildUser(s *discordgo.Session, guildID string) []*discordgo.Member
- func GenerateOptionMap(i *discordgo.InteractionCreate) map[string]*discordgo.ApplicationCommandInteractionDataOption
- func GetTimestampFromId(id string) (time.Time, error)
- func HoursOfUnix(unix int64) uint
- func NewTimers(d time.Duration, fn func(chan struct{}))
- func SendAlert(pos string, message string)
- func SendDebug(message ...any)
- func SendError(err error)
- func SendSuccess(message string)
- func SendWarn(message string)
- func TrimMessage(s string) string
- type ResponseBuilder
- func (res *ResponseBuilder) Client(c *discordgo.Session) *ResponseBuilder
- func (res *ResponseBuilder) Embeds(e []*discordgo.MessageEmbed) *ResponseBuilder
- func (res *ResponseBuilder) Interaction(i *discordgo.InteractionCreate) *ResponseBuilder
- func (res *ResponseBuilder) IsDeferred() *ResponseBuilder
- func (res *ResponseBuilder) IsEdit() *ResponseBuilder
- func (res *ResponseBuilder) IsEphemeral() *ResponseBuilder
- func (res *ResponseBuilder) Message(s string) *ResponseBuilder
- func (res *ResponseBuilder) NotDeferred() *ResponseBuilder
- func (res *ResponseBuilder) NotEdit() *ResponseBuilder
- func (res *ResponseBuilder) NotEphemeral() *ResponseBuilder
- func (res *ResponseBuilder) Send() error
Constants ¶
View Source
const ( StrongGreen = 0x09D67C Green = 0x10E6AD LightGreen = 0x9DDDCD DarkRed = 0x831010 Red = 0xF74D53 LightBlue = 0x34A6F4 Blue = 0x10889E Rose = 0xF8C7DA Camel = 0xF4D694 Violet = 0xC5A2FF Error = DarkRed Alert = Red Success = Green GreatSuccess = StrongGreen Neutral = Camel Nice = Rose )
View Source
const ( AnsiReset = "\033[0m" AnsiRed = "\033[31m" AnsiGreen = "\033[32m" AnsiYellow = "\033[33m" AnsiBlue = "\033[34m" AnsiMagenta = "\033[35m" AnsiCyan = "\033[36m" AnsiWhite = "\033[37m" AnsiBlueBold = "\033[34;1m" AnsiMagentaBold = "\033[35;1m" AnsiRedBold = "\033[31;1m" AnsiYellowBold = "\033[33;1m" )
Variables ¶
View Source
var DebugEnabled bool
Functions ¶
func AStringContains ¶
AStringContains checks if a slice "a" contains a "b" string
func ComesFromDM ¶
ComesFromDM returns true if a message comes from a DM channel
func FetchGuildUser ¶
FetchGuildUser returns the list of member in a guild
func GenerateOptionMap ¶
func GenerateOptionMap(i *discordgo.InteractionCreate) map[string]*discordgo.ApplicationCommandInteractionDataOption
func HoursOfUnix ¶
HoursOfUnix returns the hours of a unix timestamp
func NewTimers ¶
NewTimers produce a new async ticker.
d is for the duration between two ticks and fn is the functions called at each tick: it takes a chan in parameter, and you can put anything here to disable the ticker
func TrimMessage ¶
TrimMessage trims a "s" string and remove bad chars, links and pings
Types ¶
type ResponseBuilder ¶
type ResponseBuilder struct { I *discordgo.InteractionCreate C *discordgo.Session // contains filtered or unexported fields }
ResponseBuilder helps to response to slash commands
func (*ResponseBuilder) Client ¶
func (res *ResponseBuilder) Client(c *discordgo.Session) *ResponseBuilder
func (*ResponseBuilder) Embeds ¶
func (res *ResponseBuilder) Embeds(e []*discordgo.MessageEmbed) *ResponseBuilder
func (*ResponseBuilder) Interaction ¶
func (res *ResponseBuilder) Interaction(i *discordgo.InteractionCreate) *ResponseBuilder
func (*ResponseBuilder) IsDeferred ¶
func (res *ResponseBuilder) IsDeferred() *ResponseBuilder
func (*ResponseBuilder) IsEdit ¶
func (res *ResponseBuilder) IsEdit() *ResponseBuilder
func (*ResponseBuilder) IsEphemeral ¶
func (res *ResponseBuilder) IsEphemeral() *ResponseBuilder
func (*ResponseBuilder) Message ¶
func (res *ResponseBuilder) Message(s string) *ResponseBuilder
func (*ResponseBuilder) NotDeferred ¶
func (res *ResponseBuilder) NotDeferred() *ResponseBuilder
func (*ResponseBuilder) NotEdit ¶
func (res *ResponseBuilder) NotEdit() *ResponseBuilder
func (*ResponseBuilder) NotEphemeral ¶
func (res *ResponseBuilder) NotEphemeral() *ResponseBuilder
Click to show internal directories.
Click to hide internal directories.