notifications

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 15 Imported by: 0

README

Notifications

Simple notifications plugin for YAGPDB.

Will provide general notifications in a server for the following events:

  • User join
  • User leave
  • Topc changed
  • Message pinned

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{}

Functions

func GetChannel

func GetChannel(guild *dstate.GuildState, channel int64) int64

GetChannel makes sure the channel is in the guild, if not it returns no channel

func HandleChannelUpdate

func HandleChannelUpdate(evt *eventsystem.EventData)

func HandleGuildMemberAdd

func HandleGuildMemberAdd(evt *eventsystem.EventData)

func HandleGuildMemberRemove

func HandleGuildMemberRemove(evt *eventsystem.EventData)

func HandleNotificationsGet

func HandleNotificationsGet(w http.ResponseWriter, r *http.Request) interface{}

func HandleNotificationsPost

func HandleNotificationsPost(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)

func RegisterPlugin

func RegisterPlugin()

Types

type Config

type Config struct {
	configstore.GuildConfigModel
	JoinServerEnabled bool   `json:"join_server_enabled" schema:"join_server_enabled"`
	JoinServerChannel string `json:"join_server_channel" schema:"join_server_channel" valid:"channel,true"`
	JoinServerMsg     string `json:"join_server_msg" schema:"join_server_msg" valid:"template,2000"`

	JoinDMEnabled bool   `json:"join_dm_enabled" schema:"join_dm_enabled"`
	JoinDMMsg     string `json:"join_dm_msg" schema:"join_dm_msg" valid:"template,2000"`

	LeaveEnabled bool   `json:"leave_enabled" schema:"leave_enabled"`
	LeaveChannel string `json:"leave_channel" schema:"leave_channel" valid:"channel,true"`
	LeaveMsg     string `json:"leave_msg" schema:"leave_msg" valid:"template,500"`

	TopicEnabled bool   `json:"topic_enabled" schema:"topic_enabled"`
	TopicChannel string `json:"topic_channel" schema:"topic_channel" valid:"channel,true"`
}

func GetConfig

func GetConfig(guildID int64) *Config

func (*Config) GetName

func (c *Config) GetName() string

func (*Config) JoinServerChannelInt

func (c *Config) JoinServerChannelInt() (i int64)

func (*Config) LeaveChannelInt

func (c *Config) LeaveChannelInt() (i int64)

func (*Config) TableName

func (c *Config) TableName() string

func (*Config) TopicChannelInt

func (c *Config) TopicChannelInt() (i int64)

type Plugin

type Plugin struct{}

func (*Plugin) InitBot

func (p *Plugin) InitBot()

func (*Plugin) InitWeb

func (p *Plugin) InitWeb()

func (*Plugin) Name

func (p *Plugin) Name() string

Jump to

Keyboard shortcuts

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