Documentation
¶
Index ¶
- Constants
- Variables
- func BotGetFile(config tgbotapi.FileConfig) (tgbotapi.File, error)
- func BotGetSelf() tgbotapi.User
- func BotGetStickerSet(config tgbotapi.GetStickerSetConfig) (tgbotapi.StickerSet, error)
- func BotRequest(c tgbotapi.Chattable) error
- func BotSend(c tgbotapi.Chattable) (tgbotapi.Message, error)
- func CallBack(callbackQueryID string, text string)
- func CallBackWithAlert(callbackQueryID string, text string)
- func CheckUserSubscription(update *tgbotapi.Update, channelUsername string) bool
- func CleanTmp()
- func Compress(src, dest string) error
- func CopyFile(src, dst string) error
- func DeleteMsg(chatID int64, MsgID int)
- func DownloadFile(fileUrl string) (string, error)
- func EditMsgText(chatID int64, msgID int, msg string, entity ...tgbotapi.MessageEntity)
- func EditMsgTextAndMarkup(chatID int64, msgID int, msg string, markup tgbotapi.InlineKeyboardMarkup)
- func EntityBold(text, boldPart string) tgbotapi.MessageEntity
- func EntityCode(text, part string) tgbotapi.MessageEntity
- func EntityLink(text, part, url string) tgbotapi.MessageEntity
- func EntityMention(text, part string) tgbotapi.MessageEntity
- func EntityTag(text, part string) tgbotapi.MessageEntity
- func EntityTextLink(text, part, url string) tgbotapi.MessageEntity
- func EntityUnderline(text, boldPart string) tgbotapi.MessageEntity
- func GetChatID(update *tgbotapi.Update) int64
- func GetFileExtName(fileName string) string
- func GetLogPrefixCallbackQuery(update *tgbotapi.Update) string
- func GetLogPrefixMessage(update *tgbotapi.Update) string
- func GetUID(update *tgbotapi.Update) int64
- func Init(api *tgbotapi.BotAPI)
- func IsExist(path string) bool
- func JsonEncode(data any) string
- func LogUserInfo(update *tgbotapi.Update) string
- func MD5(v string) string
- func MD5File(filename string) (string, error)
- func MD5Short(v string) string
- func RandString() string
- func RemoveFile(path string)
- func SendAction(chaiID int64, action ChatAction)
- func SendFileByFileID(update *tgbotapi.Update, fileID string) error
- func SendFileByPath(update *tgbotapi.Update, filePath string) (tgbotapi.Message, error)
- func SendImg(update *tgbotapi.Update, fileData []byte) (msgSent tgbotapi.Message)
- func SendPlainText(update *tgbotapi.Update, text string, entity ...tgbotapi.MessageEntity)
- func SendPlainTextWithKeyboard(update *tgbotapi.Update, text string, keyboard *tgbotapi.ReplyKeyboardMarkup, ...)
- func SendSticker(update *tgbotapi.Update, fileID string)
- type ChatAction
- type ConvertTask
- type UploadFile
Constants ¶
View Source
const ( ChatActionTyping = ChatAction("typing") ChatActionUploadPhoto = ChatAction("upload_photo") ChatActionSendDocument = ChatAction("upload_document") )
View Source
const MB = 1 << 20
Variables ¶
View Source
var Limiter ratelimit.Limiter
Functions ¶
func BotGetFile ¶
func BotGetFile(config tgbotapi.FileConfig) (tgbotapi.File, error)
func BotGetSelf ¶ added in v1.4.3
func BotGetStickerSet ¶
func BotGetStickerSet(config tgbotapi.GetStickerSetConfig) (tgbotapi.StickerSet, error)
func BotRequest ¶
func CallBackWithAlert ¶
func CheckUserSubscription ¶ added in v1.7.5
CheckUserSubscription 检查用户是否订阅频道
func DownloadFile ¶
func EditMsgText ¶
func EditMsgText(chatID int64, msgID int, msg string, entity ...tgbotapi.MessageEntity)
func EditMsgTextAndMarkup ¶
func EditMsgTextAndMarkup(chatID int64, msgID int, msg string, markup tgbotapi.InlineKeyboardMarkup)
func EntityBold ¶
func EntityBold(text, boldPart string) tgbotapi.MessageEntity
func EntityCode ¶
func EntityCode(text, part string) tgbotapi.MessageEntity
func EntityLink ¶
func EntityLink(text, part, url string) tgbotapi.MessageEntity
func EntityMention ¶
func EntityMention(text, part string) tgbotapi.MessageEntity
func EntityTag ¶
func EntityTag(text, part string) tgbotapi.MessageEntity
func EntityTextLink ¶
func EntityTextLink(text, part, url string) tgbotapi.MessageEntity
func EntityUnderline ¶
func EntityUnderline(text, boldPart string) tgbotapi.MessageEntity
func GetFileExtName ¶
func GetLogPrefixMessage ¶
func JsonEncode ¶
func LogUserInfo ¶
func RandString ¶
func RandString() string
func RemoveFile ¶
func RemoveFile(path string)
func SendAction ¶
func SendAction(chaiID int64, action ChatAction)
func SendPlainText ¶
func SendPlainText(update *tgbotapi.Update, text string, entity ...tgbotapi.MessageEntity)
func SendPlainTextWithKeyboard ¶
func SendPlainTextWithKeyboard(update *tgbotapi.Update, text string, keyboard *tgbotapi.ReplyKeyboardMarkup, entity ...tgbotapi.MessageEntity)
func SendSticker ¶
Types ¶
type ChatAction ¶
type ChatAction string
type ConvertTask ¶ added in v1.5.0
type UploadFile ¶
func NewUploadFile ¶
func NewUploadFile(zipPath, folderPath string) *UploadFile
func (*UploadFile) Clean ¶
func (f *UploadFile) Clean()
func (*UploadFile) UploadFragment ¶
func (f *UploadFile) UploadFragment(update *tgbotapi.Update) error
func (*UploadFile) UploadSingle ¶ added in v1.7.3
func (f *UploadFile) UploadSingle(update *tgbotapi.Update) error
Click to show internal directories.
Click to hide internal directories.