modlog

package
v0.0.0-...-0abf00b Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCommands

func InitCommands(bot *bot.Bot) (s string, list []*bcr.Command)

InitCommands ...

Types

type ActionType

type ActionType string

ActionType ...

const (
	ActionBan          ActionType = "ban"
	ActionUnban        ActionType = "unban"
	ActionKick         ActionType = "kick"
	ActionWarn         ActionType = "warn"
	ActionChannelban   ActionType = "channelban"
	ActionUnchannelban ActionType = "unchannelban"
)

Constants for action types

type Entry

type Entry struct {
	ID       int64           `json:"id"`
	ServerID discord.GuildID `json:"-"`

	UserID discord.UserID `json:"user_id"`
	ModID  discord.UserID `json:"mod_id"`

	ActionType ActionType `json:"action_type"`
	Reason     string     `json:"reason,omitempty"`

	Time time.Time `json:"timestamp"`

	ChannelID discord.ChannelID `json:"-"`
	MessageID discord.MessageID `json:"-"`
}

Entry ...

type Export

type Export struct {
	ServerID  discord.GuildID `json:"server_id"`
	Timestamp time.Time       `json:"timestamp"`

	Entries []Entry `json:"entries"`
}

Export is an export of a server's mod logs

type ModLog

type ModLog struct {
	*bot.Bot
}

ModLog can be created in two ways: either by bcr for commands, or other

func New

func New(bot *bot.Bot) *ModLog

New creates a new ModLog

func (*ModLog) Embed

func (bot *ModLog) Embed(s *state.State, entry *Entry) (embed discord.Embed)

func (*ModLog) InsertEntry

func (bot *ModLog) InsertEntry(guildID discord.GuildID, user, mod discord.UserID, timestamp time.Time, actionType ActionType, reason string) (log *Entry, err error)

InsertEntry inserts a mod log entry

func (*ModLog) Log

func (bot *ModLog) Log(
	s *state.State,
	actionType ActionType,
	guildID discord.GuildID,
	userID, modID discord.UserID,
	reason string,
) (err error)

Jump to

Keyboard shortcuts

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