edenbot

package
v0.0.0-...-d6864b1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: GPL-3.0 Imports: 12 Imported by: 1

README

Discord

Discord is used in lieu of email for communication with players, it is used for new account verification and for resetting passwords.

When a user registers, a verification code is sent to their discord account. This code is used to verify their account.

When a user forgets their password, a reset code is sent to their discord account. This code is used to reset their password.

A user is not allowed to log into Escaping Eden until their account has been verified.

If a user is not in the Escaping Eden discord server, their verification code will be withheld until the bot can reach them.

If the bot is unable to verify a user within a certain time, their account code will be revoked, and they will have to register again.

The bot is also used for user administration, such as banning and unbanning users, kicking users, issuing password resets, and more.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EdenBot

type EdenBot struct {
	DB     edendb.DatabaseType
	Log    logging.LoggerType
	Config *edenconfig.Config

	InputChannel  chan messages.EdenbotMessage
	OutputChannel chan messages.SystemManagerMessage
	// contains filtered or unexported fields
}

func NewEdenBot

func NewEdenBot(input chan messages.EdenbotMessage, output chan messages.SystemManagerMessage, db edendb.DatabaseType,
	logger logging.LoggerType, conf *edenconfig.Config) *EdenBot

func (*EdenBot) ForgotPassword

func (eb *EdenBot) ForgotPassword(data messages.AccountForgotPasswordData)

func (*EdenBot) GeneratePasswordResetToken

func (eb *EdenBot) GeneratePasswordResetToken(account *messages.Account) (token string, err error)

func (*EdenBot) GetAccountByDiscordID

func (eb *EdenBot) GetAccountByDiscordID(discordID string) (*messages.Account, messages.EdenbotErrorType)

func (*EdenBot) GetAccountByDiscordTag

func (eb *EdenBot) GetAccountByDiscordTag(discordTag string) (*messages.Account, messages.EdenbotErrorType)

func (*EdenBot) GetAccountByUsername

func (eb *EdenBot) GetAccountByUsername(username string) (*messages.Account, messages.EdenbotErrorType)

func (*EdenBot) HandleInput

func (eb *EdenBot) HandleInput(started chan bool)

func (*EdenBot) HandleVerify

func (eb *EdenBot) HandleVerify(s *discordgo.Session, m *discordgo.MessageCreate)

func (*EdenBot) Init

func (eb *EdenBot) Init() error

func (*EdenBot) IsUserInDiscordServer

func (eb *EdenBot) IsUserInDiscordServer(username string) (*discordgo.User, error)

func (*EdenBot) NotifyRegistrationChannel

func (eb *EdenBot) NotifyRegistrationChannel(userID string)

func (*EdenBot) Run

func (eb *EdenBot) Run(startNotify chan bool) error

func (*EdenBot) SaveAccount

func (eb *EdenBot) SaveAccount(account messages.Account) messages.EdenbotErrorType

func (*EdenBot) SendPasswordResetToken

func (eb *EdenBot) SendPasswordResetToken(account *messages.Account) (err error)

func (*EdenBot) SendPrivateMessage

func (eb *EdenBot) SendPrivateMessage(discordID string, output string) (message *discordgo.Message, err error)

func (*EdenBot) Shutdown

func (eb *EdenBot) Shutdown() error

func (*EdenBot) ValidateUser

func (eb *EdenBot) ValidateUser(username string, userID string) error

Jump to

Keyboard shortcuts

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