telebot

package
v0.1.99 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TBTGetUpdate - getupdate
	TBTGetUpdate = "getupdate"
	// TBTWebHook - webhook
	TBTWebHook = "webhook"
	// LOGPATHConsole - console
	LOGPATHConsole = "console"
	// LLDebug - debug
	LLDebug = "debug"
	// LLInfo - info
	LLInfo = "info"
	// LLWarn - warn
	LLWarn = "warn"
	// LLError - error
	LLError = "error"
)

Variables

View Source
var (
	// ErrConfigFile - can't load config file
	ErrConfigFile = errors.New("can't load config file")
	// ErrInvalidConfigFile - invalid config file
	ErrInvalidConfigFile = errors.New("invalid config file")
	// ErrCfgTeleBotToken - invalid tele bot token
	ErrCfgTeleBotToken = errors.New("invalid tele bot token")
	// ErrCfgTeleBotType - invalid tele bot type
	ErrCfgTeleBotType = errors.New("invalid tele bot type")
	// ErrCfgWebHook - invalid webhook config
	ErrCfgWebHook = errors.New("invalid webhook config")
	// ErrCfgLogLevel - invalid log level
	ErrCfgLogLevel = errors.New("invalid log level")
	// ErrNewTeleBot - NewBotAPI err
	ErrNewTeleBot = errors.New("NewBotAPI err")
	// ErrInvalidUser - invalid teleUser
	ErrInvalidUser = errors.New("invalid teleUser")
)

Functions

func NewTeleChatBot

func NewTeleChatBot(cfg *Config) (chatbot.ChatBot, error)

NewTeleChatBot - new tele chat bot

func ReleaseTeleBot

func ReleaseTeleBot()

ReleaseTeleBot - release telebot

func StartTeleBot

func StartTeleBot(ctx context.Context, cfg *Config, node jarviscore.JarvisNode)

StartTeleBot - start tele bot

Types

type Config

type Config struct {
	TeleBotToken  string
	TeleBotMaster string
	TeleBotType   string
	WebHookURL    string
	WebKookAddr   string
	LogPath       string
	LogLevel      string
	DebugMode     bool
	CfgPath       string
	Plugins       []string
	DefaultPlugin string
	// contains filtered or unexported fields
}

Config - config

func InitTeleBot

func InitTeleBot(filename string) (*Config, error)

InitTeleBot - init telebot

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig - load config

Jump to

Keyboard shortcuts

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