config

package
v0.0.0-...-a9b63ba Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Model          BotModel `json:"model"`
	Welcome        string   `json:"welcome"`
	GroupName      string   `json:"group_name"`
	BotName        string   `json:"bot_name"`
	Host           string   `json:"host"`
	HookAddress    string   `json:"hook_address"`
	Token          string   `json:"token"`
	Download       string   `json:"download"`
	Recognition    string   `json:"recognition"`
	Database       string   `json:"database"`
	Point          float64  `json:"point"`
	RecognitionCMD string   `json:"recognition_cmd"`
	KnownPath      string   `json:"known_path"`
	Rule           string   `json:"rule"`
	LocalURL       string   `json:"local_url"`
}

Bot ...

type BotModel

type BotModel int

BotModel ENUM(webhook,update,max)

const (
	// BotModelWebhook is a BotModel of type Webhook.
	BotModelWebhook BotModel = iota
	// BotModelUpdate is a BotModel of type Update.
	BotModelUpdate
	// BotModelMax is a BotModel of type Max.
	BotModelMax
)

func ParseBotModel

func ParseBotModel(name string) (BotModel, error)

ParseBotModel attempts to convert a string to a BotModel

func (BotModel) MarshalText

func (x BotModel) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (BotModel) String

func (x BotModel) String() string

String implements the Stringer interface.

func (*BotModel) UnmarshalText

func (x *BotModel) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type Client

type Client struct {
	APIID   int64
	APIHash string
}

type Config

type Config struct {
	Bot    Bot    `json:"bot"`
	Client Client `json:"client"`
	Debug  bool   `json:"debug"`
	Auth   string `json:"auth"`
}

func LoadConfig

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

LoadConfig ...

Jump to

Keyboard shortcuts

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