command

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetUser

func SetUser(cmd *exec.Cmd, conf *config.Config) *exec.Cmd

SetUser is to set the user for the command

Types

type Base

type Base struct {
}

Base is where all structs inherit

func (*Base) Validate

func (b *Base) Validate(m *tb.Message) bool

Validate Default implementation of Validate

type Command

type Command struct {
	*Base
}

Command the basic command

func (*Command) Exec

func (c *Command) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec executes the command

func (*Command) GetExample

func (c *Command) GetExample() string

GetExample return the how to use of this command

func (*Command) IsInline

func (c *Command) IsInline() bool

IsInline return if command is /command somethingelse

type Download

type Download struct {
	*Base
}

Download to download files

func (*Download) Exec

func (d *Download) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec to locate file and send

func (*Download) GetExample

func (d *Download) GetExample() string

GetExample return the how to use of this command

func (*Download) IsInline

func (d *Download) IsInline() bool

IsInline return if command is /command somethingelse

type Downloader

type Downloader struct {
	*Base
}

Downloader to download files

func (*Downloader) Exec

func (d *Downloader) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec to locate file and send

func (*Downloader) GetExample

func (d *Downloader) GetExample() string

GetExample return the how to use of this command

func (*Downloader) IsInline

func (d *Downloader) IsInline() bool

IsInline return if command is /command somethingelse

type Help

type Help struct {
	*ListCommands
}

Help run on help

func (*Help) Exec

func (h *Help) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec to locate file and send

type ListCommands

type ListCommands struct {
	*Base
}

ListCommands run on help

func (*ListCommands) Exec

func (l *ListCommands) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec to locate file and send

func (*ListCommands) GetExample

func (l *ListCommands) GetExample() string

GetExample return the how to use of this command

func (*ListCommands) IsInline

func (l *ListCommands) IsInline() bool

IsInline return if command is /command somethingelse

func (*ListCommands) Setup

func (l *ListCommands) Setup() (commands []string, descriptions []string)

Setup where u set the commands

func (*ListCommands) Validate

func (l *ListCommands) Validate(m *tb.Message) bool

Validate Default implementation of Validate

type Upload

type Upload struct {
	*Base
}

Upload to download files

func (*Upload) Exec

func (u *Upload) Exec(b *tb.Bot, m *tb.Message, conf *config.Config)

Exec to locate file and send

func (*Upload) GetExample

func (u *Upload) GetExample() string

GetExample return the how to use of this command

func (*Upload) IsInline

func (u *Upload) IsInline() bool

IsInline return if command is /command somethingelse

Jump to

Keyboard shortcuts

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