common

package
v0.0.0-...-fcfa919 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEmbedToQueue

func AddEmbedToQueue(embed MessageItem)

func CreateLoggerEmbeds

func CreateLoggerEmbeds(loggers []Logger) *[]discord.Embed

func CreateSenderWorker

func CreateSenderWorker()

func GetLoggerChannel

func GetLoggerChannel() discord.ChannelID

func GetModChannel

func GetModChannel() discord.ChannelID

func SendLogEmbed

func SendLogEmbed(embed MessageItem) error

func SenderWorker

func SenderWorker(embeds <-chan MessageItem, wg *sync.WaitGroup)

Types

type LogType

type LogType int64

LogType is the type of the log

const (
	// LogTypeMessageDelete is a delete message log
	LogTypeMessageDelete LogType = iota
	// LogTypeMessageUpdate is an update message log
	LogTypeMessageUpdate
	// LogTypeMessageCreate is a creation message log
	LogTypeMessageCreate
	// LogTypeMessageReactionAdd is an add reaction log
	LogTypeMessageReactionAdd
	// LogTypeGuildMemberAdd is an add member log
	LogTypeGuildMemberAdd
	// LogTypeGuildMemberRemove is a remove member log
	LogTypeGuildMemberRemove
	// LogDangerousMemberAdd is a dangerous member log
	LogDangerousMemberAdd
	// LogTypeMemberRoleAdd is a member role add log
	LogTypeMemberRoleAdd
	// LogTypeMemberRoleRemove is a member role remove log
	LogTypeMemberRoleRemove
	// LogTypeGuildMemberBan is a member ban log
	LogTypeGuildMemberBan
	// LogTypeGuildMemberUnban is a member unban log
	LogTypeGuildMemberUnban
)

func (LogType) Color

func (l LogType) Color() int

func (LogType) String

func (l LogType) String() string

type Logger

type Logger struct {
	Type    LogType
	Author  discord.User
	Message string
	Footer  *discord.EmbedFooter
}

Logger is a logger

func DangerMemberLogger

func DangerMemberLogger(member discord.User, danger MemberDangerLevel) Logger

func MemberAddLogger

func MemberAddLogger(member *discord.Member) Logger

func MemberBanLogger

func MemberBanLogger(user *discord.User) Logger

func MemberRemoveLogger

func MemberRemoveLogger(user *discord.User, roles []discord.RoleID) Logger

func MemberRoleAddLogger

func MemberRoleAddLogger(member discord.User, role discord.RoleID) Logger

func MemberRoleRemoveLogger

func MemberRoleRemoveLogger(member discord.User, role discord.RoleID) Logger

func MemberUnbanLogger

func MemberUnbanLogger(user *discord.User) Logger

func MessageDeleteLogger

func MessageDeleteLogger(message *discord.Message) Logger

func MessageUpdateLogger

func MessageUpdateLogger(message *discord.Message, oldContent string) Logger

func UnknownMessageDeleteLogger

func UnknownMessageDeleteLogger(channelID discord.ChannelID, _ discord.GuildID, messageID discord.MessageID) Logger

func (Logger) ToEmbed

func (l Logger) ToEmbed() discord.Embed

type MemberDangerLevel

type MemberDangerLevel int64
const (
	MemberDangerLevelNone MemberDangerLevel = iota
	MemberDangerLevelLow
	MemberDangerLevelMedium
	MemberDangerLevelHigh
)

func VerifyMember

func VerifyMember(member *discord.Member) MemberDangerLevel

func (MemberDangerLevel) String

func (m MemberDangerLevel) String() string

type MessageItem

type MessageItem struct {
	Embed   discord.Embed
	Channel discord.ChannelID
	Content string
}

Jump to

Keyboard shortcuts

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