autorole

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 21 Imported by: 0

README

Autorole

Autorole provides the ability to give users roles on join.

Features:

  • Give a role right on join
  • Give a role after x amount of time
  • Require a certain role to give the role
  • Ignore people with certain roles

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyProcessingFullGuild = errors.New("Already processing users on this guild")

Functions

func HandleGuildChunk added in v1.6.0

func HandleGuildChunk(evt *eventsystem.EventData)

func HandlePresenceUpdate

func HandlePresenceUpdate(evt *eventsystem.EventData)

HandlePresenceUpdate makes sure the member with joined_at is available for the relevant guilds TODO: Figure out a solution that scales better

func HandleUpdateAutoroles added in v1.4.1

func HandleUpdateAutoroles(event *pubsub.Event)

Stop updating

func KeyGeneral

func KeyGeneral(guildID int64) string

func KeyProcessing

func KeyProcessing(guildID int64) string

func OnMemberJoin

func OnMemberJoin(evt *eventsystem.EventData)

func RedisKeyGuildChunkProecssing added in v1.6.0

func RedisKeyGuildChunkProecssing(gID int64) string

func RegisterPlugin

func RegisterPlugin()

func WorkingOnFullScan added in v1.6.0

func WorkingOnFullScan(guildID int64) (bool, error)

Types

type CacheKey added in v1.8.0

type CacheKey int
const CacheKeyConfig CacheKey = 1

type Form

type Form struct {
	GeneralConfig `valid:"traverse"`
}

func (Form) Name

func (f Form) Name() string

func (Form) Save

func (f Form) Save(guildID int64) error

type GeneralConfig

type GeneralConfig struct {
	Role             int64 `json:",string" valid:"role,true"`
	RequiredDuration int

	RequiredRoles []int64 `valid:"role,true"`
	IgnoreRoles   []int64 `valid:"role,true"`
	OnlyOnJoin    bool
}

func GetGeneralConfig

func GetGeneralConfig(guildID int64) (*GeneralConfig, error)

func GuildCacheGetGeneralConfig added in v1.8.0

func GuildCacheGetGeneralConfig(gs *dstate.GuildState) (*GeneralConfig, error)

func (*GeneralConfig) CanAssignTo

func (conf *GeneralConfig) CanAssignTo(currentRoles []int64, joinedAt time.Time) bool

type Plugin

type Plugin struct{}

func (*Plugin) AddCommands added in v1.4.1

func (p *Plugin) AddCommands()

func (*Plugin) BotInit added in v1.4.1

func (p *Plugin) BotInit()

func (*Plugin) BotStarted added in v1.4.1

func (p *Plugin) BotStarted()

func (*Plugin) InitBotRestServer added in v1.6.0

func (p *Plugin) InitBotRestServer(mux *goji.Mux)

func (*Plugin) InitWeb

func (p *Plugin) InitWeb()

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) StopBot added in v1.4.7

func (p *Plugin) StopBot(wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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