mute

package
v0.0.0-...-094d83a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUserMuted

func IsUserMuted(sqlClient *sql.DB, guildID, userID string) (muted bool, err error)

IsUserMuted check if there's a mute active for the given user in the given server

func ReapplyMute

func ReapplyMute(s *discordgo.Session, sqlClient *sql.DB, m *discordgo.GuildMemberAdd) error

Types

type MutedUser

type MutedUser struct {
	UserID  string
	GuildID string
	Reason  string
}

MutedUser describes a user that is/was muted

func ExpireMutes

func ExpireMutes(s *discordgo.Session, sqlClient *sql.DB) (unmutedUsers []MutedUser, err error)

ExpireMutes polls the database for any mutes that may have ended recently. Any users who should be unmuted will have their "Muted" role removed, and the muted entry will be removed from the database. The `unmutedUsers` return value indicates what users were unmuted, what their mute reason was, and what server they were muted in.

Jump to

Keyboard shortcuts

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