autorole

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: MIT Imports: 26 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

This section is empty.

Functions

func Dir

func Dir(useLocal bool, name string) http.FileSystem

Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

func FS

func FS(useLocal bool) http.FileSystem

FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSByte

func FSByte(useLocal bool, name string) ([]byte, error)

FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSMustByte

func FSMustByte(useLocal bool, name string) []byte

FSMustByte is the same as FSByte, but panics if name is not present.

func FSMustString

func FSMustString(useLocal bool, name string) string

FSMustString is the string version of FSMustByte.

func FSString

func FSString(useLocal bool, name string) (string, error)

FSString is the string version of FSByte.

func HandleAutoroles

func HandleAutoroles(w http.ResponseWriter, r *http.Request) interface{}

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 HandleUpdateAutomodRules

func HandleUpdateAutomodRules(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 RegisterPlugin

func RegisterPlugin()

Types

type Form

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

func (Form) Name

func (f Form) Name() string

func (Form) Save

func (f Form) Save(client *redis.Client, 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(client *redis.Client, guildID int64) (*GeneralConfig, error)

func (*GeneralConfig) CanAssignTo

func (conf *GeneralConfig) CanAssignTo(member *discordgo.Member) bool

func (*GeneralConfig) UnmarshalJSON

func (l *GeneralConfig) UnmarshalJSON(b []byte) error

type LegacyGeneralConfig

type LegacyGeneralConfig struct {
	Role             string `valid:"role,true"`
	RequiredDuration int

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

type Plugin

type Plugin struct{}

func (*Plugin) InitBot

func (p *Plugin) InitBot()

func (*Plugin) InitWeb

func (p *Plugin) InitWeb()

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) StartBot

func (p *Plugin) StartBot()

Jump to

Keyboard shortcuts

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