notifications

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GuildNotificationSchema = []string{`
CREATE TABLE IF NOT EXISTS notifications_config (
	guild_id TEXT PRIMARY KEY,

	join_server_channel TEXT DEFAULT '' NOT NULL,
	join_server_message TEXT DEFAULT '' NOT NULL,

	leave_server_channel TEXT DEFAULT '' NOT NULL,
	leave_server_message TEXT DEFAULT '' NOT NULL
);
`}
View Source
var PageHTML embed.FS

Functions

func NotificationSetup

func NotificationSetup(cmdHandler *dispatch.CommandHandler)

NotificationSetup runs the following:

  • The schema initialiser
  • Registration of the guild and user join/leave functions
  • Initialises the web plugin

func SaveConfig

func SaveConfig(config *Config) error

SaveConfig saves the passed Config struct via SQLBoiler

Types

type Config

type Config struct {
	GuildID string

	JoinServerChannel string `valid:"channel,allowEmpty"`
	JoinServerMessage string `valid:"template,allowEmpty"`

	LeaveServerChannel string `valid:"channel,allowEmpty"`
	LeaveServerMessage string `valid:"template,allowEmpty"`
}

Config defines the general struct to pass data to and from the dashboard template/context data

func ConfigFromModel

func ConfigFromModel(m *models.NotificationsConfig) *Config

ConfigFromModel converts the guild config SQLBoiler model to a Config struct

func GetConfig

func GetConfig(guildID string) *Config

GetConfig returns the current or default guild config as a Config struct

func (*Config) ConfigToSQLModel

func (c *Config) ConfigToSQLModel() *models.NotificationsConfig

ConfigToSQLModel converts a Config struct to the relevant SQLBoiler model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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