internal

package
v1.1.2-0...-d05e646 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name        string
	Description string
	Aliases     []string
	Group       string
	Usage       string
	Example     string
	ServerOnly  bool
	AdminOnly   bool
	Execute     func(*pkg.Context, *Server) error
}

type CommandHandler

type CommandHandler struct {
	// contains filtered or unexported fields
}

func NewCommandHandler

func NewCommandHandler() CommandHandler

func (*CommandHandler) GetCommand

func (handler *CommandHandler) GetCommand(name string) (Command, bool)

func (*CommandHandler) GetCommands

func (handler *CommandHandler) GetCommands(group string) Commands

func (*CommandHandler) Register

func (handler *CommandHandler) Register(command Command)

type Commands

type Commands map[string]Command

type Config

type Config struct {
	Prefix  []string `json:"prefix"`
	GuildID string   `json:"guildID"`
}

func LoadConfig

func LoadConfig() Config

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(mongoDatabase *mongo.Database) Database

func (*Database) AddDiscordVerificationToken

func (database *Database) AddDiscordVerificationToken(id string) (string, error)

func (*Database) ConnectDUAccount

func (database *Database) ConnectDUAccount(discordToken string, discordID string) (string, error)

func (*Database) GetMemberCount

func (database *Database) GetMemberCount() (int64, error)

func (*Database) GetUserByDiscordID

func (database *Database) GetUserByDiscordID(discordID string) (User, error)

func (*Database) GetUserByEmail

func (database *Database) GetUserByEmail(email string) (User, error)

func (*Database) GetUserByID

func (database *Database) GetUserByID(id string) (User, error)

func (*Database) GetUserByUsername

func (database *Database) GetUserByUsername(username string) (User, error)

func (*Database) GetUsersByID

func (database *Database) GetUsersByID(ids primitive.M) ([]User, error)

func (*Database) InsertNotification

func (database *Database) InsertNotification(notification primitive.M) error

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

func NewMailer

func NewMailer(collection *mongo.Collection) Mailer

func (*Mailer) SendVerifyDiscord

func (mailer *Mailer) SendVerifyDiscord(toEmail string, token string) error

func (*Mailer) SendVerifyDiscordConfirmation

func (mailer *Mailer) SendVerifyDiscordConfirmation(toEmail string, name string) error

type Server

type Server struct {
	Bot              *discordgo.Member
	Channels         channels
	CommandHandler   CommandHandler
	Config           Config
	Controller       *pkg.Controller
	Database         Database
	Discord          *discordgo.Session
	Guild            *discordgo.Guild
	Mailer           Mailer
	ReactionListener pkg.ReactionListener
	Ready            bool
	Roles            roles
	Status           discordgo.UpdateStatusData
}

func NewServer

func NewServer(config Config, discord *discordgo.Session) *Server

func (*Server) Init

func (server *Server) Init() error

func (*Server) InitController

func (server *Server) InitController() error

func (*Server) InitRules

func (server *Server) InitRules() error

type User

type User struct {
	ID      primitive.ObjectID `bson:"_id, omitempty"`
	Details struct {
		Username string
		Name     string
		Email    string
	}
	Profile struct {
		Colour string
		Status string
		Bio    string
		URL    string
	}
	Agora struct {
		Score struct {
			Posts int32
			Stars int32
		}
	}

	ConnectedApps struct {
		Discord string
	}
}

Jump to

Keyboard shortcuts

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