polls

package
v0.0.0-...-ff1933e Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 14 Imported by: 0

README

Polls

Required ENV settings:

  • POLLS_GUILDS - guilds (separated by ;) to enable command in

Database

Initial startup will create the tables needed. The user defined should have the following rights to the database (it is recommended to create a new database that this user only has access to)

  • SELECT
  • UPDATE
  • CREATE
  • ALTER

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseOldPolls

func CloseOldPolls(ds *discordgo.Session)

Types

type Module

type Module struct {
	api.Module
}

func (*Module) Load

func (*Module) Load(ds *discordgo.Session)

func (*Module) Name

func (*Module) Name() string

type Poll

type Poll struct {
	gorm.Model
	ChannelId string `gorm:"index"`
	MessageId string `gorm:"uniqueIndex"`
	Title     string
	Closed    bool
	Started   time.Time
	EndAt     time.Time `gorm:"index"`
}

type Vote

type Vote struct {
	gorm.Model
	MessageId string `gorm:"uniqueIndex:vote_idx;index:"`
	UserId    string `gorm:"uniqueIndex:vote_idx"`
	Vote      string
}

Jump to

Keyboard shortcuts

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