Versions in this module Expand all Collapse all v1 v1.24.19 Mar 7, 2021 Changes in this version type CommandTriggerType + const CommandTriggerNone type CustomCommand + ShowErrors bool type Plugin + func (p *Plugin) AllFeatureFlags() []string + func (p *Plugin) UpdateFeatureFlags(guildID int64) ([]string, error) v1.20.6 Sep 3, 2019 Changes in this version + const CCMessageExecLimitNormal + const CCMessageExecLimitPremium + const MaxCommands + const MaxCommandsPremium + const MaxGroups + const MaxUserMessages + const ReactionModeAddOnly + const ReactionModeBoth + const ReactionModeRemoveOnly + var AllTriggerTypes = []CommandTriggerType + var CCExecLock = keylock.NewKeyLock() + var DBSchemas = []string + var DelayedCCRunLimit = multiratelimit.NewMultiRatelimiter(0.1, 10) + var RegexCache = *ccache.New(ccache.Configure()) + func BotCachedGetCommandsWithMessageTriggers(gs *dstate.GuildState, ctx context.Context) ([]*models.CustomCommand, error) + func CalcNextRunTime(cc *models.CustomCommand, now time.Time) time.Time + func CheckGuildDBLimit(gs *dstate.GuildState) (bool, error) + func CheckIntervalLimits(ctx context.Context, guildID int64, cmdID int64, templateData web.TemplateData) (ok bool, err error) + func CheckLimits(in ...string) bool + func CheckMatch(globalPrefix string, cmd *models.CustomCommand, msg string) (match bool, stripped string, args []string) + func CheckMatchReaction(cmd *models.CustomCommand, reaction *discordgo.MessageReaction, add bool) (match bool) + func CmdRunsForUser(cc *models.CustomCommand, ms *dstate.MemberState) bool + func CmdRunsInChannel(cc *models.CustomCommand, channel int64) bool + func DelNextRunEvent(guildID int64, cmdID int64) error + func ExecuteCustomCommand(cmd *models.CustomCommand, tmplCtx *templates.Context) error + func ExecuteCustomCommandFromMessage(cmd *models.CustomCommand, member *dstate.MemberState, cs *dstate.ChannelState, ...) error + func ExecuteCustomCommandFromReaction(cc *models.CustomCommand, ms *dstate.MemberState, cs *dstate.ChannelState, ...) error + func FindCommands(ccs []*models.CustomCommand, data *dcmd.Data) (foundCCS []*models.CustomCommand, provided bool) + func HandleCommands(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleDeleteCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleDeleteGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleGetCommandsGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleMessageCreate(evt *eventsystem.EventData) + func HandleNewCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleNewGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleUpdateCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleUpdateGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func KeyCommands(guildID int64) string + func MaxCommandsForContext(ctx context.Context) int + func RegisterPlugin() + func ServeGroupSelected(r *http.Request, templateData web.TemplateData, groupID int64, guildID int64) (web.TemplateData, error) + func StringCommands(ccs []*models.CustomCommand) string + func UpdateCommandNextRunTime(cc *models.CustomCommand, updateLastRun bool) error + type CCExecKey struct + CCID int64 + GuildID int64 + type CacheKey int + const CacheKeyCommands + const CacheKeyDBLimits + const CacheKeyReactionCommands + type CommandTriggerType int + const CommandTriggerCommand + const CommandTriggerContains + const CommandTriggerExact + const CommandTriggerInterval + const CommandTriggerReaction + const CommandTriggerRegex + const CommandTriggerStartsWith + func TriggerTypeFromForm(str string) CommandTriggerType + func (t CommandTriggerType) String() string + type CustomCommand struct + CaseSensitive bool + Channels []int64 + ContextChannel int64 + GroupID int64 + ID int64 + ReactionTriggerMode int + RequireChannels bool + RequireRoles bool + Response string + Responses []string + Roles []int64 + TimeTriggerExcludingDays []int64 + TimeTriggerExcludingHours []int64 + TimeTriggerInterval int + Trigger string + TriggerType CommandTriggerType + TriggerTypeForm string + func LegacyGetCommands(guild int64) ([]*CustomCommand, int64, error) + func (cc *CustomCommand) Migrate() *CustomCommand + func (cc *CustomCommand) ToDBModel() *models.CustomCommand + func (cc *CustomCommand) Validate(tmpl web.TemplateData) (ok bool) + type CustomCommandSlice []*CustomCommand + func (c CustomCommandSlice) Len() int + func (c CustomCommandSlice) Less(i, j int) bool + func (c CustomCommandSlice) Swap(i, j int) + type DelayedRunCCData struct + ChannelID int64 + CmdID int64 + Member *dstate.MemberState + Message *discordgo.Message + UserData []byte + UserKey interface{} + type DelayedRunLimitKey struct + ChannelID int64 + GuildID int64 + type GroupForm struct + BlacklistChannels []int64 + BlacklistRoles []int64 + ID int64 + Name string + WhitelistChannels []int64 + WhitelistRoles []int64 + type LightDBEntry struct + CreatedAt time.Time + ExpiresAt time.Time + GuildID int64 + ID int64 + Key string + UpdatedAt time.Time + User discordgo.User + UserID int64 + Value interface{} + func ToLightDBEntry(m *models.TemplatesUserDatabase) (*LightDBEntry, error) + type NextRunScheduledEvent struct + CmdID int64 + type ParsedArgs struct + func (pa *ParsedArgs) Get(index int) interface{} + func (pa *ParsedArgs) IsSet(index int) interface{} + type Plugin struct + func (p *Plugin) AddCommands() + func (p *Plugin) BotInit() + func (p *Plugin) InitWeb() + func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func (p *Plugin) PluginInfo() *common.PluginInfo + type TriggeredCC struct + Args []string + CC *models.CustomCommand + Stripped string