panicbot

package module
v0.0.0-...-12410d6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: BSD-3-Clause Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

panicbot

A discord bot designed to allow for moderators to take immediate action and or contact the administrator of the server over forms of communication other than discord in the case of an emergency

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedToVote

type AllowedToVote struct {
	PanicAlert struct {
		Users []string
		Roles []string
	}
	PanicBan struct {
		Users []string
		Roles []string
	}
}

type Discord

type Discord interface {
	BanUser(userID string, reason string, days int) error
	SendChannelMessage(channelID string, message string) error
	SendDMEmbed(userID, content, description, titleText, buttonLabel, buttonID string) error
	SendDM(userID string, message string) error
	GetAllGuildMembers() ([]UserRoles, error)
	GetGuildMemberUsername(userID string) (string, error)
}

type DiscordImpl

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

func NewDiscord

func NewDiscord(args *DiscordImplArgs) (*DiscordImpl, error)

func (*DiscordImpl) BanUser

func (d *DiscordImpl) BanUser(userID string, reason string, days int) error

func (*DiscordImpl) GetAllGuildMembers

func (d *DiscordImpl) GetAllGuildMembers() ([]UserRoles, error)

func (*DiscordImpl) GetGuildMemberUsername

func (d *DiscordImpl) GetGuildMemberUsername(userID string) (string, error)

func (*DiscordImpl) SendChannelMessage

func (d *DiscordImpl) SendChannelMessage(channelID string, content string) error

func (*DiscordImpl) SendDM

func (d *DiscordImpl) SendDM(userID string, message string) error

func (*DiscordImpl) SendDMEmbed

func (d *DiscordImpl) SendDMEmbed(userID, content, description, titleText, buttonLabel, buttonID string) error

type DiscordImplArgs

type DiscordImplArgs struct {
	AllowedToVote         AllowedToVote
	BotToken              string
	GuildID               string
	PrimaryChannelID      string
	Logger                *log.Logger
	Session               *discordgo.Session
	EmbedReactionCallback func(userID, buttonID string)
	PanicAlertCallback    func(message string)
	PanicBanCallback      func(userID, targetUserID, reason string, days float64)
	RoleRemovedCallback   func(user, role string)
}

type Twilio

type Twilio interface {
	SendMessage(toNumber, body string) error
}

type TwilioImpl

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

func NewTwilio

func NewTwilio(args *TwilioImplArgs) (*TwilioImpl, error)

func (*TwilioImpl) SendMessage

func (Twilio *TwilioImpl) SendMessage(toNumber, body string) error

type TwilioImplArgs

type TwilioImplArgs struct {
	AccountSID        string
	APIKey            string
	APISecret         string
	TwilioPhoneNumber string
	Logger            *log.Logger
	Client            *twilio.RestClient
}

type UserRoles

type UserRoles struct {
	UserID string
	Roles  []string
}

Directories

Path Synopsis
cmd
panicbot command
internal

Jump to

Keyboard shortcuts

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