verification

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 29 Imported by: 0

README

verification

This plugin provides a simple verification system.

The initial implementation forces you to pass a captcha to get access to the server.

Documentation

Index

Constants

View Source
const DBSchema = `` /* 662-byte string literal not displayed */
View Source
const DefaultDMMessage = `` /* 191-byte string literal not displayed */
View Source
const (
	DefaultPageContent = `## Verification

Please solve the following reCAPTCHA to make sure you're not a robot`
)

Variables

View Source
var GoogleReCAPTCHASecret = os.Getenv("YAGPDB_GOOGLE_RECAPTCHA_SECRET")
View Source
var GoogleReCAPTCHASiteKey = os.Getenv("YAGPDB_GOOGLE_RECAPTCHA_SITE_KEY")

Functions

func RandStringRunes

func RandStringRunes(n int) string

func RegisterPlugin

func RegisterPlugin()

func ScheduledEventMW

func ScheduledEventMW(innerHandler func(ms *dstate.MemberState, guildID int64, conf *models.VerificationConfig, rawData interface{}) (bool, error)) func(evt *seventsmodels.ScheduledEvent, data interface{}) (retry bool, err error)

Types

type CheckCAPTCHARequest

type CheckCAPTCHARequest struct {
	Secret   string `json:"secret"`
	Response string `json:"response"`
}

type CheckCAPTCHAResponse

type CheckCAPTCHAResponse struct {
	Success     bool     `json:"success"`
	ChallengeTS string   `json:"challenge_ts"`
	Hostname    string   `json:"hostname"`
	ErrorCodes  []string `json:"error-codes"`
}

type FormData

type FormData struct {
	Enabled             bool
	VerifiedRole        int64  `valid:"role"`
	PageContent         string `valid:",10000"`
	KickUnverifiedAfter int
	WarnUnverifiedAfter int
	WarnMessage         string `valid:"template,10000"`
	DMMessage           string `valid:"template,10000"`
	LogChannel          int64  `valid:"channel,true"`
}

type Plugin

type Plugin struct{}

func (*Plugin) AddCommands

func (p *Plugin) AddCommands()

func (*Plugin) BotInit

func (p *Plugin) BotInit()

func (*Plugin) InitWeb

func (p *Plugin) InitWeb()

func (*Plugin) LoadServerHomeWidget

func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)

func (*Plugin) PluginInfo

func (p *Plugin) PluginInfo() *common.PluginInfo

type VerificationEventData

type VerificationEventData struct {
	UserID int64  `json:"user_id"`
	Token  string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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