src

package
v0.0.0-...-0d6f856 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BotToken         = ""
	ChannelName      = ""
	AudioFilePath    = ""
	ImageFilePath    = ""
	TrojanServerAddr = ""
	TrojanServerPort = 443
	TrojanPassword   = ""
	TrojanSNI        = ""
	ProxyURL         = "" // 请替换成 Clash 代理的实际地址和端口
)

Variables

This section is empty.

Functions

func FileToBytes

func FileToBytes(filePath string) ([]byte, error)

func GetFileExtensionWithoutDot

func GetFileExtensionWithoutDot(filePath string) string

GetFileExtensionWithoutDot 获取文件路径的文件类型后缀并去掉点

func ListFilesInFolder

func ListFilesInFolder(folderPath string) ([]string, error)

Types

type TgSrv

type TgSrv struct {
	Bot          *tgbotapi.BotAPI
	ChannelName  string
	ProxyURL     string
	BotToken     string
	LatestChatId int64
}

func NewTgSrv

func NewTgSrv() *TgSrv

func (*TgSrv) Send

func (s *TgSrv) Send(message string) error

func (*TgSrv) ShareFile

func (s *TgSrv) ShareFile(chatId int64, suffix string, fileId string) (*tgbotapi.Message, error)

分享文件

func (*TgSrv) Updates

func (s *TgSrv) Updates()

更新消息

func (*TgSrv) UploadFile

func (s *TgSrv) UploadFile(chatID int64, filePath string) (string, error)

上传文件

Jump to

Keyboard shortcuts

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