telegram

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bot                *telego.Bot
	BotUsername        string // 没有 @
	ChannelChatID      telego.ChatID
	GroupChatID        telego.ChatID // 附属群组
	IsChannelAvailable bool          // 是否可以发布到频道
)
View Source
var (
	CommonCommands = []telego.BotCommand{
		{
			Command:     "start",
			Description: "开始涩涩",
		},
		{
			Command:     "file <index>",
			Description: "获取原图文件",
		},
		{
			Command:     "files",
			Description: "获取作品所有图片文件",
		},
		{
			Command:     "setu",
			Description: "来点涩图",
		},
		{
			Command:     "random",
			Description: "随机1张全年龄图片",
		},
		{
			Command:     "search",
			Description: "搜索图片",
		},
		{
			Command:     "info",
			Description: "计算图片信息",
		},
		{
			Command:     "stats",
			Description: "统计数据",
		},
		{
			Command:     "help",
			Description: "食用指南",
		},
	}

	AdminCommands = []telego.BotCommand{
		{
			Command:     "set_admin",
			Description: "设置管理员",
		},
		{
			Command:     "delete",
			Description: "删除作品",
		},
		{
			Command:     "r18",
			Description: "设置作品 R18",
		},
		{
			Command:     "title",
			Description: "设置作品标题",
		},
		{
			Command:     "tags",
			Description: "设置作品标签(覆盖)",
		},
		{
			Command:     "addtags",
			Description: "添加作品标签",
		},
		{
			Command:     "deltags",
			Description: "删除作品标签",
		},
		{
			Command:     "post",
			Description: "发布作品 <url>",
		},
	}
)

Functions

func InitBot

func InitBot()

func PostAndCreateArtwork

func PostAndCreateArtwork(ctx context.Context, artwork *types.Artwork, bot *telego.Bot, fromID int64, messageID int) error

func RunPolling

func RunPolling()

func SendArtworkInfo

func SendArtworkInfo(ctx context.Context, bot *telego.Bot, params *utils.SendArtworkInfoParams) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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