commands

package
v0.0.0-...-5c90490 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MissingUserNameMessage = "_Нужен один аргумент — ник пользователя._"

Variables

This section is empty.

Functions

This section is empty.

Types

type Announce

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

func NewAnnounce

func NewAnnounce(s sender, subscriberChatIDsGetter subscriberChatIDsGetter) *Announce

func (Announce) Execute

func (a Announce) Execute(msg *tgbotapi.Message)

func (Announce) Help

func (Announce) Help() string

func (Announce) Hidden

func (Announce) Hidden() bool

func (Announce) Name

func (Announce) Name() string

func (Announce) SuperAdminOnly

func (Announce) SuperAdminOnly() bool

type BanRegex

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

func NewBanRegex

func NewBanRegex(s sender, b banner, r newlyDisallowedMessageCleaner) *BanRegex

func (BanRegex) Execute

func (br BanRegex) Execute(msg *tgbotapi.Message)

func (BanRegex) Help

func (BanRegex) Help() string

func (BanRegex) Hidden

func (BanRegex) Hidden() bool

func (BanRegex) Name

func (BanRegex) Name() string

func (BanRegex) SuperAdminOnly

func (BanRegex) SuperAdminOnly() bool

type ByPickCount

type ByPickCount []db.EventPickCountEntry

func (ByPickCount) Len

func (c ByPickCount) Len() int

func (ByPickCount) Less

func (c ByPickCount) Less(i, j int) bool

func (ByPickCount) Swap

func (c ByPickCount) Swap(i, j int)

type Chats

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

func NewChats

func NewChats(s sender, c chatsGetter, k killswitchGetter) *Chats

func (Chats) Execute

func (c Chats) Execute(msg *tgbotapi.Message)

func (Chats) Help

func (Chats) Help() string

func (Chats) Hidden

func (Chats) Hidden() bool

func (Chats) Name

func (Chats) Name() string

func (Chats) SuperAdminOnly

func (Chats) SuperAdminOnly() bool

type Clear

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

func NewClear

func NewClear(s sender, c clearer) *Clear

func (Clear) Execute

func (c Clear) Execute(msg *tgbotapi.Message)

func (Clear) Help

func (Clear) Help() string

func (Clear) Hidden

func (Clear) Hidden() bool

func (Clear) Name

func (Clear) Name() string

func (Clear) SuperAdminOnly

func (Clear) SuperAdminOnly() bool

type Command

type Command interface {
	Name() string
	Help() string
	Hidden() bool
	SuperAdminOnly() bool
	Execute(msg *tgbotapi.Message)
}

type CommandHandler

type CommandHandler struct {
	Commands         []Command
	DefaultHandler   func(msg *tgbotapi.Message)
	ForbiddenHandler func(msg *tgbotapi.Message)
	// contains filtered or unexported fields
}

func NewCommandHandler

func NewCommandHandler(superAdminChecker superAdminChecker) *CommandHandler

func (CommandHandler) Handle

func (h CommandHandler) Handle(msg *tgbotapi.Message)

func (CommandHandler) List

func (h CommandHandler) List() []Command

func (*CommandHandler) ListForMenu

func (h *CommandHandler) ListForMenu() []tgbotapi.BotCommand

type Event

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

func NewEvent

func NewEvent(
	snd sender,
	memp memberDB,
	chs chatSelector,
	eopdl eventOncePerDayLimiter,
	pickCnt pickCounter,
) *Event

func (Event) Execute

func (e Event) Execute(message *tgbotapi.Message)

func (Event) Help

func (Event) Help() string

func (Event) Hidden

func (Event) Hidden() bool

func (Event) Name

func (Event) Name() string

func (Event) SuperAdminOnly

func (Event) SuperAdminOnly() bool

type FilterInfo

type FilterInfo interface {
	Description() filters.Description
	ScrutinyModeOnly() bool
}

type FilterOnOff

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

func NewFilterOff

func NewFilterOff(s sender, f filterToggler, v filterIDValidator) *FilterOnOff

func NewFilterOn

func NewFilterOn(s sender, f filterToggler, v filterIDValidator) *FilterOnOff

func (FilterOnOff) Execute

func (f FilterOnOff) Execute(msg *tgbotapi.Message)

func (FilterOnOff) Help

func (f FilterOnOff) Help() string

func (FilterOnOff) Hidden

func (FilterOnOff) Hidden() bool

func (FilterOnOff) Name

func (f FilterOnOff) Name() string

func (FilterOnOff) SuperAdminOnly

func (FilterOnOff) SuperAdminOnly() bool

type Filters

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

func NewFilters

func NewFilters(
	snd sender,
	fil filterInfoLister,
	fec filterEnabledChecker,
	fif filterInfoFormatter,
) *Filters

func (Filters) Execute

func (f Filters) Execute(msg *tgbotapi.Message)

func (Filters) Help

func (Filters) Help() string

func (Filters) Hidden

func (Filters) Hidden() bool

func (Filters) Name

func (Filters) Name() string

func (Filters) SuperAdminOnly

func (Filters) SuperAdminOnly() bool

type GetUpdateNews

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

func NewGetUpdateNews

func NewGetUpdateNews(snd sender, sub subscriber) *GetUpdateNews

func (GetUpdateNews) Execute

func (g GetUpdateNews) Execute(msg *tgbotapi.Message)

func (GetUpdateNews) Help

func (GetUpdateNews) Help() string

func (GetUpdateNews) Hidden

func (GetUpdateNews) Hidden() bool

func (GetUpdateNews) Name

func (GetUpdateNews) Name() string

func (GetUpdateNews) SuperAdminOnly

func (GetUpdateNews) SuperAdminOnly() bool

type List

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

func NewList

func NewList(s sender, b bannedChannelsGetter) *List

func (List) Execute

func (l List) Execute(msg *tgbotapi.Message)

func (List) Help

func (List) Help() string

func (List) Hidden

func (List) Hidden() bool

func (List) Name

func (List) Name() string

func (List) SuperAdminOnly

func (List) SuperAdminOnly() bool

type ListRegex

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

func NewListRegex

func NewListRegex(s sender, b bannedRegexGetter) *ListRegex

func (ListRegex) Execute

func (l ListRegex) Execute(msg *tgbotapi.Message)

func (ListRegex) Help

func (ListRegex) Help() string

func (ListRegex) Hidden

func (ListRegex) Hidden() bool

func (ListRegex) Name

func (ListRegex) Name() string

func (ListRegex) SuperAdminOnly

func (ListRegex) SuperAdminOnly() bool

type MarkdownFilterInfoFormatter

type MarkdownFilterInfoFormatter struct{}

func (MarkdownFilterInfoFormatter) Format

func (MarkdownFilterInfoFormatter) Format(info FilterInfo, isEnabled bool) string

type NoUpdateNews

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

func NewNoUpdateNews

func NewNoUpdateNews(s sender, u unsubscriber) *NoUpdateNews

func (NoUpdateNews) Execute

func (n NoUpdateNews) Execute(msg *tgbotapi.Message)

func (NoUpdateNews) Help

func (NoUpdateNews) Help() string

func (NoUpdateNews) Hidden

func (NoUpdateNews) Hidden() bool

func (NoUpdateNews) Name

func (NoUpdateNews) Name() string

func (NoUpdateNews) SuperAdminOnly

func (NoUpdateNews) SuperAdminOnly() bool

type OnOff

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

func NewOff

func NewOff(s sender, ks killswitchSetter) *OnOff

func NewOn

func NewOn(s sender, ks killswitchSetter) *OnOff

func (OnOff) Execute

func (f OnOff) Execute(msg *tgbotapi.Message)

func (OnOff) Help

func (f OnOff) Help() string

func (OnOff) Hidden

func (OnOff) Hidden() bool

func (OnOff) Name

func (f OnOff) Name() string

func (OnOff) SuperAdminOnly

func (OnOff) SuperAdminOnly() bool

type RestartNotif

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

func NewRestartNotif

func NewRestartNotif(s superAdminChatIDSetter) *RestartNotif

func (RestartNotif) Execute

func (r RestartNotif) Execute(msg *tgbotapi.Message)

func (RestartNotif) Help

func (RestartNotif) Help() string

func (RestartNotif) Hidden

func (RestartNotif) Hidden() bool

func (RestartNotif) Name

func (RestartNotif) Name() string

func (RestartNotif) SuperAdminOnly

func (RestartNotif) SuperAdminOnly() bool

type RmSticker

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

func NewRmSticker

func NewRmSticker(snd sender, sr stickerRemover) *RmSticker

func (*RmSticker) Execute

func (c *RmSticker) Execute(message *tgbotapi.Message)

func (RmSticker) Help

func (RmSticker) Help() string

func (RmSticker) Hidden

func (RmSticker) Hidden() bool

func (RmSticker) Name

func (RmSticker) Name() string

func (RmSticker) SuperAdminOnly

func (RmSticker) SuperAdminOnly() bool

type STFU

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

func NewSTFU

func NewSTFU(s sender, m muter, r randomDurationGenerator) *STFU

func (STFU) Execute

func (s STFU) Execute(msg *tgbotapi.Message)

func (STFU) Help

func (STFU) Help() string

func (STFU) Hidden

func (STFU) Hidden() bool

func (STFU) Name

func (STFU) Name() string

func (STFU) SuperAdminOnly

func (STFU) SuperAdminOnly() bool

type Say

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

func NewSay

func NewSay(s sender, c chatsOrdinalGetter) *Say

func (Say) Execute

func (s Say) Execute(msg *tgbotapi.Message)

func (Say) Help

func (Say) Help() string

func (Say) Hidden

func (Say) Hidden() bool

func (Say) Name

func (Say) Name() string

func (Say) SuperAdminOnly

func (Say) SuperAdminOnly() bool

type Scrutiny

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

func NewScrutiny

func NewScrutiny(snd sender, sa scrutinyAdder) *Scrutiny

func (Scrutiny) Execute

func (s Scrutiny) Execute(msg *tgbotapi.Message)

func (Scrutiny) Help

func (Scrutiny) Help() string

func (Scrutiny) Hidden

func (Scrutiny) Hidden() bool

func (Scrutiny) Name

func (Scrutiny) Name() string

func (Scrutiny) SuperAdminOnly

func (Scrutiny) SuperAdminOnly() bool

type Start

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

func NewStart

func NewStart(s sender) *Start

func (Start) Execute

func (s Start) Execute(msg *tgbotapi.Message)

func (Start) Help

func (Start) Help() string

func (Start) Hidden

func (Start) Hidden() bool

func (Start) Name

func (Start) Name() string

func (Start) SuperAdminOnly

func (Start) SuperAdminOnly() bool

type Stickers

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

func NewStickers

func NewStickers(s sender, sl stickerLister) *Stickers

func (Stickers) Execute

func (s Stickers) Execute(msg *tgbotapi.Message)

func (Stickers) Help

func (Stickers) Help() string

func (Stickers) Hidden

func (Stickers) Hidden() bool

func (Stickers) Name

func (Stickers) Name() string

func (Stickers) SuperAdminOnly

func (Stickers) SuperAdminOnly() bool

type UnSTFU

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

func NewUnSTFU

func NewUnSTFU(s sender, u unmuter) *UnSTFU

func (UnSTFU) Execute

func (u UnSTFU) Execute(msg *tgbotapi.Message)

func (UnSTFU) Help

func (UnSTFU) Help() string

func (UnSTFU) Hidden

func (UnSTFU) Hidden() bool

func (UnSTFU) Name

func (UnSTFU) Name() string

func (UnSTFU) SuperAdminOnly

func (UnSTFU) SuperAdminOnly() bool

type UnbanRegex

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

func NewUnbanRegex

func NewUnbanRegex(s sender, u unbanner) *UnbanRegex

func (UnbanRegex) Execute

func (u UnbanRegex) Execute(msg *tgbotapi.Message)

func (UnbanRegex) Help

func (UnbanRegex) Help() string

func (UnbanRegex) Hidden

func (UnbanRegex) Hidden() bool

func (UnbanRegex) Name

func (UnbanRegex) Name() string

func (UnbanRegex) SuperAdminOnly

func (UnbanRegex) SuperAdminOnly() bool

type Unscrutiny

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

func NewUnscrutiny

func NewUnscrutiny(s sender, sr scrutinyRemover) *Unscrutiny

func (Unscrutiny) Execute

func (u Unscrutiny) Execute(msg *tgbotapi.Message)

func (Unscrutiny) Help

func (Unscrutiny) Help() string

func (Unscrutiny) Hidden

func (Unscrutiny) Hidden() bool

func (Unscrutiny) Name

func (Unscrutiny) Name() string

func (Unscrutiny) SuperAdminOnly

func (Unscrutiny) SuperAdminOnly() bool

Jump to

Keyboard shortcuts

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