Documentation ¶
Index ¶
- Variables
- func CheckNickname(gDB *gorm.DB, nicknameStmt *sql.Stmt, userID, guildID int64, nickname string)
- func CheckUsername(gDB *gorm.DB, usernameStmt *sql.Stmt, user *discordgo.User)
- func Dir(useLocal bool, name string) http.FileSystem
- func EvtProcesser()
- func EvtProcesserGCs()
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func HandleDeleteMessageJson(w http.ResponseWriter, r *http.Request) interface{}
- func HandleGC(evt *eventsystem.EventData)
- func HandleLogsCP(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleLogsCPDelete(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleLogsCPSaveGeneral(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleLogsHTML(w http.ResponseWriter, r *http.Request) interface{}
- func HandleMsgDelete(evt *eventsystem.EventData)
- func HandlePresenceUpdate(evt *eventsystem.EventData)
- func HandleQueueEvt(evt *eventsystem.EventData)
- func InitPlugin()
- type DeleteData
- type GeneralFormData
- type GuildLoggingConfig
- type Message
- type MessageLog
- type NicknameListing
- type Plugin
- type UsernameListing
Constants ¶
This section is empty.
Variables ¶
var (
ErrChannelBlacklisted = errors.New("Channel blacklisted from creating message logs")
)
Functions ¶
func CheckNickname ¶
func Dir ¶
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func EvtProcesser ¶
func EvtProcesser()
Queue up all the events and process them one by one, because of limited connections
func EvtProcesserGCs ¶
func EvtProcesserGCs()
func FS ¶
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶
FSMustString is the string version of FSMustByte.
func HandleDeleteMessageJson ¶
func HandleDeleteMessageJson(w http.ResponseWriter, r *http.Request) interface{}
func HandleGC ¶
func HandleGC(evt *eventsystem.EventData)
func HandleLogsCP ¶
func HandleLogsCP(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleLogsCPDelete ¶
func HandleLogsCPDelete(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleLogsCPSaveGeneral ¶
func HandleLogsCPSaveGeneral(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleLogsHTML ¶
func HandleLogsHTML(w http.ResponseWriter, r *http.Request) interface{}
func HandleMsgDelete ¶
func HandleMsgDelete(evt *eventsystem.EventData)
Mark all log messages with this id as deleted
func HandlePresenceUpdate ¶
func HandlePresenceUpdate(evt *eventsystem.EventData)
func HandleQueueEvt ¶
func HandleQueueEvt(evt *eventsystem.EventData)
While presence update is sent when user changes username.... MAKES NO SENSE IMO BUT WHATEVER Also check nickname incase the user came online
func InitPlugin ¶
func InitPlugin()
Types ¶
type DeleteData ¶
type DeleteData struct {
ID string
}
type GeneralFormData ¶
type GuildLoggingConfig ¶
type GuildLoggingConfig struct { configstore.GuildConfigModel UsernameLoggingEnabled bool NicknameLoggingEnabled bool BlacklistedChannels string ManageMessagesCanViewDeleted bool EveryoneCanViewDeleted bool ParsedBlacklistedchannels []string `gorm:"-"` }
func GetConfig ¶
func GetConfig(guildID int64) (*GuildLoggingConfig, error)
Returns either stored config, err or a default config
func (*GuildLoggingConfig) GetName ¶
func (g *GuildLoggingConfig) GetName() string
func (*GuildLoggingConfig) PostFetch ¶
func (g *GuildLoggingConfig) PostFetch()
type MessageLog ¶
type MessageLog struct { gorm.Model Messages []Message ChannelName string ChannelID string GuildID string Author string AuthorID string }
func CreateChannelLog ¶
func CreateChannelLog(config *GuildLoggingConfig, guildID, channelID int64, author string, authorID int64, count int) (*MessageLog, error)
func GetChannelLogs ¶
func GetChannelLogs(id int64) (*MessageLog, error)
func GetGuilLogs ¶
func GetGuilLogs(guildID int64, before, after, limit int) ([]*MessageLog, error)
func (*MessageLog) Link ¶
func (m *MessageLog) Link() string
type NicknameListing ¶
type NicknameListing struct { gorm.Model UserID int64 `gorm:"index"` GuildID string Nickname string }
func GetNicknames ¶
func GetNicknames(userID, guildID int64, limit int) ([]NicknameListing, error)
type UsernameListing ¶
func GetUsernames ¶
func GetUsernames(userID int64, limit int) ([]UsernameListing, error)