command

package
v0.0.0-...-a1560d6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessAppMentionEvent

func ProcessAppMentionEvent(event *slackevents.AppMentionEvent)

func ProcessMessageEvent

func ProcessMessageEvent(event *slackevents.MessageEvent)

Types

type AllNftsCommand

type AllNftsCommand struct{}

func (*AllNftsCommand) Run

func (c *AllNftsCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type BalanceCommand

type BalanceCommand struct{}

func (*BalanceCommand) Run

func (c *BalanceCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type BotResponse

type BotResponse struct {
	Pretext        string
	Text           string
	Fields         []slack.AttachmentField
	ReplyTimeStamp string
}

func RunCommand

func RunCommand(name string, event *CoinEvent) (BotResponse, error)

type CoinEvent

type CoinEvent struct {
	User           *model.User
	Channel        string
	Message        string
	ReplyTimeStamp string
}

type Command

type Command interface {
	Run(msg string, event *CoinEvent) (BotResponse, error)
}

type CreateCoinCommand

type CreateCoinCommand struct{}

func (*CreateCoinCommand) Run

func (c *CreateCoinCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type CreateNftCommand

type CreateNftCommand struct{}

func (*CreateNftCommand) Run

func (c *CreateNftCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type DestroyCoinCommand

type DestroyCoinCommand struct{}

func (*DestroyCoinCommand) Run

func (c *DestroyCoinCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type IdentityCommand

type IdentityCommand struct{}

func (*IdentityCommand) Run

func (c *IdentityCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type MyNftsCommand

type MyNftsCommand struct{}

func (*MyNftsCommand) Run

func (c *MyNftsCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type Registry

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

CommandRegistry contains Command implementations that implement custom behaviors for each supported koin command

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Lookup

func (r *Registry) Lookup(name string) (Command, error)

Lookup returns the Command implementation or an error if one can't be found.

func (*Registry) Register

func (r *Registry) Register(name string, impl Command)

Register registers impl for commands. It will be called by ProcessMessage()

type SelfIdentityCommand

type SelfIdentityCommand struct{}

func (*SelfIdentityCommand) Run

func (c *SelfIdentityCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type StatsCommand

type StatsCommand struct{}

func (*StatsCommand) Run

func (c *StatsCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

TODO: Add more stats - coins received, coins transfered, total coins

type TransferCoinCommand

type TransferCoinCommand struct{}

func (*TransferCoinCommand) Run

func (c *TransferCoinCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

type TransferNftCommand

type TransferNftCommand struct{}

func (*TransferNftCommand) Run

func (c *TransferNftCommand) Run(msg string, event *CoinEvent) (BotResponse, error)

Jump to

Keyboard shortcuts

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