automod

package
v0.0.0-...-ab872db Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoMod

type AutoMod struct {
	// contains filtered or unexported fields
}

func NewAutoMod

func NewAutoMod(opt Option) *AutoMod

func (*AutoMod) AddUserToDeniedList

func (a *AutoMod) AddUserToDeniedList(userId UserId)

func (*AutoMod) GenerateAlertMessage

func (a *AutoMod) GenerateAlertMessage(i *discordgo.MessageCreate) *discordgo.MessageSend

func (*AutoMod) GetTrackedChannelIds

func (a *AutoMod) GetTrackedChannelIds() []ChannelId

func (*AutoMod) GetUserMessages

func (a *AutoMod) GetUserMessages(userId UserId) map[string]string

GetUserMessages retrieves the messages associated with a user and organizes them in a map. The keys of the map represent the channel IDs, and the corresponding values are the message IDs.

Note: This function is designed to be used with an AutoMod instance and requires a valid UserId parameter.

Parameters:

  • userId: The unique identifier of the user for whom messages are to be retrieved.

Returns:

  • map[string]string: A map where keys are channel IDs, and values are message IDs.

func (*AutoMod) GetUserUniqueMessages

func (a *AutoMod) GetUserUniqueMessages(userId UserId) map[string]string

func (*AutoMod) IsChannelIdTrackable

func (a *AutoMod) IsChannelIdTrackable(channelId ChannelId) bool

func (*AutoMod) IsUserInDeniedList

func (a *AutoMod) IsUserInDeniedList(userId UserId) bool

func (*AutoMod) IsUserWithinMaxChannelsLimit

func (a *AutoMod) IsUserWithinMaxChannelsLimit(userId UserId) bool

func (*AutoMod) SetChannels

func (a *AutoMod) SetChannels(channels []*discordgo.Channel)

func (*AutoMod) StoreMessage

func (a *AutoMod) StoreMessage(userId UserId, channelId ChannelId, message Message)

type ChannelId

type ChannelId string

type Message

type Message struct {
	ID        string `json:"id"`
	CreatedAt int64  `json:"createdAt"` // Unix timestamp
	Content   string `json:"content"`
}

func NewMessage

func NewMessage(ID string, content string) (Message, error)

type Option

type Option struct {
	MessageTTL int
	DenyTTL    int
}

type UserId

type UserId string

Jump to

Keyboard shortcuts

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