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 ¶
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 (*Config) ConfigToSQLModel ¶
func (c *Config) ConfigToSQLModel() *models.NotificationsConfig
ConfigToSQLModel converts a Config struct to the relevant SQLBoiler model
Click to show internal directories.
Click to hide internal directories.