Versions in this module Expand all Collapse all v1 v1.31.14 Jan 12, 2022 Changes in this version + func HandleDragCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + type DragCmdData struct + ID int64 + NewIndex int + OldIndex int v1.31.13 Jan 7, 2022 v1.31.12 Dec 22, 2021 v1.31.11 Dec 14, 2021 v1.31.10 Dec 7, 2021 v1.31.9 Oct 13, 2021 Changes in this version + var PageHTML string v1.29.1 Jul 28, 2021 v1.29.0 Jul 21, 2021 v1.28.0 Jun 28, 2021 Changes in this version + type CacheKey struct + GuildID int64 + MessageID int64 v1.27.0 Jun 14, 2021 v1.26.3 May 12, 2021 v1.26.2 May 5, 2021 v1.26.0 May 5, 2021 Changes in this version + const GroupModeMultiple + const GroupModeNone + const GroupModeSingle + const RoleMenuStateDone + const RoleMenuStateEditingOptionReplacing + const RoleMenuStateEditingOptionSelecting + const RoleMenuStateSettingUp + var DBSchemas = []string + func CheckIgnoredRoles(ignore []int64, has []int64) error + func CheckRequiredRoles(requireOneOf []int64, has []int64) bool + func ClearRolemenuCache(gID int64) + func ClearRolemenuCacheGS(gs *dstate.GuildState) + func CmdFuncListCommands(parsed *dcmd.Data) (interface{}, error) + func CmdFuncRole(parsed *dcmd.Data) (interface{}, error) + func ContinueRoleMenuSetup(ctx context.Context, rm *models.RoleMenu, emoji *discordgo.Emoji, userID int64) (resp string, err error) + func FindRolemenuFull(ctx context.Context, mID int64, guildID int64) (*models.RoleMenu, error) + func FindToggleRole(ctx context.Context, ms *dstate.MemberState, name string) (gaveRole bool, err error) + func GetAllRoleCommandsSorted(ctx context.Context, guildID int64) (groups []*models.RoleGroup, ...) + func GetRolemenuCached(ctx context.Context, gs *dstate.GuildState, messageID int64) (*models.RoleMenu, error) + func HandleDeleteRoleCommands(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleGetGroup(groupID int64, w http.ResponseWriter, r *http.Request) (tmpl web.TemplateData, err error) + func HandleGetIndex(w http.ResponseWriter, r *http.Request) (tmpl web.TemplateData, err error) + func HandleMoveCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleNewCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleNewGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleRemoveCommand(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleRemoveGroup(w http.ResponseWriter, r *http.Request) (web.TemplateData, error) + func HandleUpdateCommand(w http.ResponseWriter, r *http.Request) (tmpl web.TemplateData, err error) + func HandleUpdateGroup(w http.ResponseWriter, r *http.Request) (tmpl web.TemplateData, err error) + func HumanizeAssignError(guild *dstate.GuildState, err error) (string, error) + func IsRoleCommandError(err error) bool + func MemberChooseOption(ctx context.Context, rm *models.RoleMenu, gs *dstate.GuildState, ...) (resp string, err error) + func MenuReactedNotDone(ctx context.Context, gs *dstate.GuildState, rm *models.RoleMenu, ...) (resp string, err error) + func NewCommonRoleError(msg string, r *CommonRoleSettings) error + func NewGroupError(msg string, group *models.RoleGroup) error + func NewLmitError(msg string, limit int) error + func NewRoleError(msg string, role int64) error + func NewSimpleError(format string, args ...interface{}) error + func NextRoleMenuSetupStep(ctx context.Context, rm *models.RoleMenu, first bool) (resp string, err error) + func OptionName(gs *dstate.GuildState, opt *models.RoleMenuOption) string + func OptionsLessFunc(standalone bool, slice []*models.RoleMenuOption) func(int, int) bool + func RegisterPlugin() + func RoleCommandsLessFunc(slice []*models.RoleCommand) func(int, int) bool + func StrFlags(rm *models.RoleMenu) string + func StringCommands(cmds []*models.RoleCommand) string + func UpdateMenu(parsed *dcmd.Data, menu *models.RoleMenu) (interface{}, error) + func UpdateRoleMenuMessage(ctx context.Context, rm *models.RoleMenu) error + type CommonRoleError struct + Group *CommonRoleSettings + Message string + func (r *CommonRoleError) Error() string + type CommonRoleSettings struct + BlacklistRoles []int64 + MenuOption *models.RoleMenuOption + ParentBlacklistRoles []int64 + ParentGroup *models.RoleGroup + ParentGroupMode int + ParentMenu *models.RoleMenu + ParentWhitelistRoles []int64 + RoleCmd *models.RoleCommand + RoleId int64 + WhitelistRoles []int64 + func CommonRoleFromRoleCommand(group *models.RoleGroup, cmd *models.RoleCommand) *CommonRoleSettings + func CommonRoleFromRoleMenuCommand(rm *models.RoleMenu, option *models.RoleMenuOption) *CommonRoleSettings + func (c *CommonRoleSettings) AllGroupRoles(ctx context.Context) []*CommonRoleSettings + func (c *CommonRoleSettings) AssignRole(ctx context.Context, ms *dstate.MemberState) (gaveRole bool, err error) + func (c *CommonRoleSettings) CanRole(ctx context.Context, ms *dstate.MemberState) (can bool, err error) + func (c *CommonRoleSettings) CheckToggleRole(ctx context.Context, ms *dstate.MemberState) (gaveRole bool, err error) + func (c *CommonRoleSettings) GroupToggleRole(ctx context.Context, ms *dstate.MemberState) (gaveRole bool, err error) + func (c *CommonRoleSettings) MaybeScheduleRoleRemoval(ctx context.Context, ms *dstate.MemberState) error + func (c *CommonRoleSettings) ModeSettings() *ModeSettings + func (c *CommonRoleSettings) ParentCanRole(ctx context.Context, ms *dstate.MemberState) (can bool, err error) + func (c *CommonRoleSettings) RemoveRole(ctx context.Context, ms *dstate.MemberState) (removedRole bool, err error) + func (c *CommonRoleSettings) ToggleRole(ms *dstate.MemberState) (gaveRole bool, err error) + type FormCommand struct + Group int64 + ID int64 + IgnoreRoles []int64 + Name string + RequireRoles []int64 + Role int64 + type FormGroup struct + ID int64 + IgnoreRoles []int64 + Mode int + MultipleMax int + MultipleMin int + Name string + RequireRoles []int64 + SingleAutoToggleOff bool + SingleRequireOne bool + TemporaryRoleDuration int + type GroupError struct + Group *models.RoleGroup + Message string + func (r *GroupError) Error() string + type LmitError struct + Limit int + Message string + func (r *LmitError) Error() string + type MenuCacheKey int64 + type ModeSettings struct + Mode int64 + MultipleMax int64 + MultipleMin int64 + SingleAutoToggleOff bool + SingleRequireOne bool + TemporaryRoleDuration int + 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 RecentMenusTracker struct + EvictionAge time.Duration + GuildStartTimes map[int64]time.Time + RecentMenus []*RecentTrackedMenu + Started time.Time + func NewRecentMenusTracker(evictionTreshold time.Duration) *RecentMenusTracker + func (r *RecentMenusTracker) AddMenu(msgID int64) + func (r *RecentMenusTracker) CheckRecentTrackedMenu(guildID int64, msgID int64) (outOfTimeRange bool, checkDB bool) + func (r *RecentMenusTracker) GuildReset(guildID int64) + func (r *RecentMenusTracker) RunLoop() + type RecentTrackedMenu struct + MsgID int64 + type RoleError struct + Message string + Role int64 + func (r *RoleError) Error() string + func (r *RoleError) PrettyError(roles []*discordgo.Role) string + type ScheduledEventUpdateMenuMessageData struct + GuildID int64 + MessageID int64 + type ScheduledMemberRoleRemoveData struct + GroupID int64 + GuildID int64 + RoleID int64 + UserID int64 + type SimpleError string + func (s SimpleError) Error() string