Documentation ¶
Index ¶
- func AddAction(punishment *Action) (*mongo.InsertOneResult, error)
- func AddBlockedString(guildid string, level int, str string) (*mongo.UpdateResult, error)
- func AddBlockedSubstring(guildid string, level int, substring string) (*mongo.UpdateResult, error)
- func AddConfig(config *MongoGuild) (*mongo.InsertOneResult, error)
- func AddGuild(g *discordgo.Guild, invokedByUserID string) *structs.Config
- func AddUntrustworthy(u *structs.Untrustworthy) error
- func CheckPermission(s *discordgo.Session, conf *structs.Config, guildid string, userid string, ...) (string, bool)
- func CheckTargets(s *discordgo.Session, conf *structs.Config, guildid string, actioner string, ...) bool
- func DeleteMute(guildid string, userid string) (*mongo.DeleteResult, error)
- func DeleteUntrustworthy(id string) error
- func ExportConfigYAML(guildid string) ([]byte, error)
- func GetAllUntrustworthy() ([]structs.Untrustworthy, error)
- func GetConfig(id string) (*structs.Config, error)
- func GetLevel(s *discordgo.Session, conf *structs.Config, guildid string, userid string) int64
- func GetMultipleUntrustworthy(in []*structs.Untrustworthy) ([]*structs.Untrustworthy, error)
- func GetPermission(s *discordgo.Session, conf *structs.Config, guildid string, permission string) (int64, error)
- func GetSingleUntrustworthy(in *structs.Untrustworthy) (*structs.Untrustworthy, error)
- func ImportConfigYAML(guildid string, in []byte) error
- func IsStaff(s *discordgo.Session, conf *structs.Config, guildid string, userid string) bool
- func LoadFlatConfig() structs.FlatConfig
- func LoadGopherlinkConfig() structs.GopherlinkConfig
- func MakeConfig(g *discordgo.Guild, invokedByUserID string) *structs.Config
- func MakeMuteCmd(s *discordgo.Session, conf *structs.Config, m *discordgo.Message, ...)
- func NoPermissionHandler(s *discordgo.Session, m *discordgo.Message, conf *structs.Config, ...)
- func RemoveAction(guildid string, uuid string) (*mongo.DeleteResult, error)
- func SetConfig(id string, config *structs.Config) (*mongo.UpdateResult, error)
- func SetLevel(s *discordgo.Session, guildid string, userid string, level int64) error
- func SetMutedRole(guildid string, roleid string) (*mongo.UpdateResult, error)
- func SetPermission(s *discordgo.Session, guildid string, permission string, level int64) error
- func SetupCmd(s *discordgo.Session, conf *structs.Config, m *discordgo.Message, ...)
- func StartDB(cfg structs.MongoConfig)
- func UpdateAutomod(guildid string, automod *structs.Automod) (*mongo.UpdateResult, error)
- type Action
- func GetActions(guildid string, userid string) ([]*Action, error)
- func GetBan(guildid string, userid string) (*Action, error)
- func GetMute(guildid string, userid string) (*Action, error)
- func GetNonPunishments(guildid string, userid string) ([]*Action, error)
- func GetPunishmentByUUID(guildid string, uuid string) (*Action, error)
- func GetPunishments(guildid string, userid string) ([]*Action, error)
- type DB
- type MongoGuild
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBlockedString ¶
func AddBlockedSubstring ¶
func AddConfig ¶
func AddConfig(config *MongoGuild) (*mongo.InsertOneResult, error)
func AddUntrustworthy ¶
func AddUntrustworthy(u *structs.Untrustworthy) error
func CheckPermission ¶
func CheckPermission(s *discordgo.Session, conf *structs.Config, guildid string, userid string, permission interface{}) (string, bool)
will return a string of the failed permission if appropriate
func CheckTargets ¶
func DeleteMute ¶
func DeleteMute(guildid string, userid string) (*mongo.DeleteResult, error)
func DeleteUntrustworthy ¶
func ExportConfigYAML ¶
func GetAllUntrustworthy ¶
func GetAllUntrustworthy() ([]structs.Untrustworthy, error)
func GetMultipleUntrustworthy ¶
func GetMultipleUntrustworthy(in []*structs.Untrustworthy) ([]*structs.Untrustworthy, error)
func GetPermission ¶
func GetSingleUntrustworthy ¶
func GetSingleUntrustworthy(in *structs.Untrustworthy) (*structs.Untrustworthy, error)
func ImportConfigYAML ¶
func LoadFlatConfig ¶
func LoadFlatConfig() structs.FlatConfig
func LoadGopherlinkConfig ¶
func LoadGopherlinkConfig() structs.GopherlinkConfig
func MakeMuteCmd ¶
func NoPermissionHandler ¶
func RemoveAction ¶
func RemoveAction(guildid string, uuid string) (*mongo.DeleteResult, error)
func SetMutedRole ¶
func SetMutedRole(guildid string, roleid string) (*mongo.UpdateResult, error)
Set funcs
func SetPermission ¶
func StartDB ¶
func StartDB(cfg structs.MongoConfig)
func UpdateAutomod ¶
Update automod funcs
Types ¶
type Action ¶
type Action struct { // for timestamps ID primitive.ObjectID `bson:"_id,omitempty"` // action data GuildID string `bson:"guildID"` UserID string `bson:"userID"` Issuer string `bson:"issuer"` Type string `bson:"type"` Expires int64 `bson:"expires,omitempty"` // punishment specific fields // mutes RoleID string `bson:"roleID,omitempty"` // strikes Weight int64 `bson:"weight,omitempty"` Reason string `bson:"reason,omitempty"` UUID string `bson:"uuid"` }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) ConnectDB ¶
func (db *DB) ConnectDB(mongoCfg structs.MongoConfig)
func (*DB) GetBlackMesaUser ¶
func (db *DB) GetBlackMesaUser(id string) (*structs.BlackMesaUser, error)
func (*DB) GetMongoClient ¶
type MongoGuild ¶
Click to show internal directories.
Click to hide internal directories.