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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址