Documentation ¶
Index ¶
- Constants
- Variables
- func CalcStats(s *discordgo.Session)
- func CheckForImage(m *discordgo.Message) bool
- func CheckForVideo(m *discordgo.Message) bool
- func FilteredCommand(input string) (output string)
- func FilteredTrigger(input string) (output string)
- func GetClosestLevel(i []int64, targetLevel int64) int64
- func IsDevInstance(s *discordgo.Session) bool
- func MakeCompleteCensorStruct(automod *structs.Automod, channelID string, userLevel int64) (combined *structs.Censor)
- func MakeCompleteSpamStruct(automod *structs.Automod, channelID string, userLevel int64) (combined *structs.Spam)
- func MakeReason(conf *structs.Config, guildId, userId, module, function, trigger string) (reason string)
- func ParseTime(strTime string) int64
- func ReplaceReasonVariable(conf *structs.Config, strikes []*db.Action, reason string, ...) string
- func SnowflakeToTimestamp(userId string) time.Time
- type ReasonVariable
Constants ¶
View Source
const ZeroWidth = "\u200B"
Variables ¶
View Source
var NumberRegex = regexp.MustCompile(`[0-9]*[.]?[0-9]+`)
View Source
var RoleIdRegex = regexp.MustCompile(`^(?:<@&!?)?(\d+)>?$`)
View Source
var SnowflakeRegex = regexp.MustCompile(`([0-9]{17,19})`)
View Source
var TimeRegex = map[int64]*regexp.Regexp{ 1: regexp.MustCompile(`(\d+)s`), 60: regexp.MustCompile(`(\d+)m`), 3600: regexp.MustCompile(`(\d+)h`), 86400: regexp.MustCompile(`(\d+)d`), 604800: regexp.MustCompile(`(\d+)w`), 2628000: regexp.MustCompile(`(\d+)mo`), 31536000: regexp.MustCompile(`(\d+)y`), }
seconds to regex for the string of it, makes iteration easier as you can use k as the multiplier for v
View Source
var UserIdRegex = regexp.MustCompile(`^(?:<@!?)?(\d+)>?$`)
View Source
var UuidRegex = regexp.MustCompile(`\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b`)
Functions ¶
func CheckForImage ¶
func CheckForVideo ¶
func FilteredCommand ¶
func FilteredTrigger ¶
func GetClosestLevel ¶
Gets the closest level that the ideal level can match in the level -> interface map
func IsDevInstance ¶
func MakeCompleteSpamStruct ¶
func MakeReason ¶
func ReplaceReasonVariable ¶
func SnowflakeToTimestamp ¶
Types ¶
type ReasonVariable ¶
type ReasonVariable string
var ( ReasonVariableModule ReasonVariable = "{{module}}" ReasonVariableFunction ReasonVariable = "{{function}}" ReasonVariableTrigger ReasonVariable = "{{trigger}}" ReasonVariableTriggerCensored ReasonVariable = "{{trigger_censored}}" ReasonVariableStrikeNo ReasonVariable = "{{strike_no}}" ReasonVariableStrikesUntil ReasonVariable = "{{strikes_until}}" ReasonVariableNextPunishment ReasonVariable = "{{next_punishment}}" ReasonVariableNextPunishmentLength ReasonVariable = "{{next_punishment_length}}" )
Click to show internal directories.
Click to hide internal directories.