Documentation ¶
Index ¶
- Constants
- func CheckCtxTimeout(ctx context.Context) error
- func ContextFromDiscordInteractionCreate(parent context.Context, i *discordgo.InteractionCreate, timeout time.Duration) (context.Context, context.CancelFunc)
- func ContextFromDiscordMessageCreate(parent context.Context, m *discordgo.MessageCreate) context.Context
- func ContextFromDiscordReactionAdd(parent context.Context, r *discordgo.MessageReactionAdd) context.Context
- func ContextFromListenConfig(parent context.Context, guildId, channelId string) context.Context
- func GetLastMonth(now time.Time) string
- func Healthcheck(w http.ResponseWriter, _ *http.Request)
- func IntSliceToStr(in []int) []string
- func PreprocessRoll(input string) string
Examples ¶
Constants ¶
View Source
const InteractionEvtType = "interaction"
View Source
const MessageEvtType = "message"
View Source
const ReactionEvtType = "reaction"
Variables ¶
This section is empty.
Functions ¶
func CheckCtxTimeout ¶ added in v1.2.0
func ContextFromDiscordInteractionCreate ¶ added in v1.2.0
func ContextFromDiscordInteractionCreate(parent context.Context, i *discordgo.InteractionCreate, timeout time.Duration) (context.Context, context.CancelFunc)
func ContextFromDiscordMessageCreate ¶ added in v1.2.0
func ContextFromDiscordReactionAdd ¶ added in v1.6.0
func ContextFromListenConfig ¶ added in v1.2.0
func GetLastMonth ¶ added in v1.2.0
GetLastMonth gets the string for the previous month in YYYY-MM format
func Healthcheck ¶ added in v1.2.0
func Healthcheck(w http.ResponseWriter, _ *http.Request)
func IntSliceToStr ¶
func PreprocessRoll ¶ added in v1.4.0
PreprocessRoll handles preprocessing roll data from user input. Currently, this converts "d20" -> "1d20" for common shorthand
Example ¶
s := PreprocessRoll("d20 + d8 + 1d4") fmt.Println(s)
Output: 1d20 + 1d8 + 1d4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.