internal

package
v0.0.0-...-d21d471 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(configPath string)

Types

type Bot

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

func (*Bot) Add

func (b *Bot) Add(m *dg.MessageCreate, args []string)

This is the add command args = [prefix, add, question ... \n .. answer]

func (*Bot) Get

func (b *Bot) Get(s *dg.Session, m *dg.MessageCreate, args []string)

This is the get command args = [prefix, get, question context ... ]

func (*Bot) List

func (b *Bot) List(s *dg.Session, m *dg.MessageCreate)

This is the list command

func (*Bot) Remove

func (b *Bot) Remove(s *dg.Session, m *dg.MessageCreate, args []string)

This is the remove command args = [prefix, remove, question context]

func (*Bot) RemoveFromChannel

func (b *Bot) RemoveFromChannel(s *discordgo.Session, m *discordgo.MessageCreate, question string)

This will remove a question from the FaQ channel (it will seek up to 100 messages)

func (*Bot) Set

func (b *Bot) Set(s *dg.Session, m *dg.MessageCreate, args []string)

This is the set command args = [prefix, set, question ... new answer]

func (*Bot) Sync

func (b *Bot) Sync(s *dg.Session, m *dg.MessageCreate)

This is the sync command

type Config

type Config struct {
	Prefix     string `yaml:"prefix"`
	Token      string `yaml:"token"`
	Auth       string `yaml:"auth_server"`
	FaQChannel string `yaml:"channel"`
	DBLocation string `yaml:"db_location"`
}

type Controller

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

func GetController

func GetController(location string) Controller

This will get a new database controller

func (Controller) Add

func (c Controller) Add(guild string, question string, answer string) error

Add a new question / answer

func (Controller) GetAll

func (c Controller) GetAll(guild string) ([]FaQ, error)

Get all the FaQ's from a guild

func (Controller) Remove

func (c Controller) Remove(guild string, question string) error

Remove a question

func (Controller) Set

func (c Controller) Set(guild string, question string, answer string) error

Set a question's answer

type FaQ

type FaQ struct {
	Guild, Question, Answer string
}

Jump to

Keyboard shortcuts

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