user2bot

package module
v0.0.0-...-8f64cb2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 4 Imported by: 0

README

user2bot

Go Reference Go Report Card Coverage Status Tests

Library for unified controlling of both users and bots in telegram

Documentation

Overview

<There will be module docs here>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Where to store session configuration. Must be set for both bot and userbot
	SessionFile    string
	PublicKeysFile string
	// Host address of mtproto server. Actually, it can be any mtproxy, not only official
	// Default: "149.154.167.50:443"
	MTProtoServerHost string
	AppID             int64
	AppHash           string
	// Default: "Unknown"
	//DeviceModel string
	// Default: "linux/amd64"
	//SystemVersion string
	// Default: "0.1.0"
	//AppVersion string
	PhoneNumber string
}

TODO Add deafults

type Session

type Session interface {
	InitAuth() error
	IsNeedToSendAuthCode() bool
	SendAuthCode(code string) error
	IsNeedToSendPassword() bool
	SendPassword(pass string) error
	InitSession() error
	// RequestNextEvent()
	Close() error
}

func SessionFromConfig

func SessionFromConfig(config Config) (Session, error)

Jump to

Keyboard shortcuts

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