文件

API 參考

本頁列出各 package 入口。涉及網路操作的 SDK call 都使用 context.Context

共通生命週期模式

Package Constructor 生命週期 Handler
telegram New(token, opts...) Start(ctx)Close()Status() Reply(handler)
discord New(token) Start(ctx)Close()Status() Reply(handler)
line New(secret, token, port, opts...) Start(ctx)Close()Status() Reply(handler)

Telegram

提供 SendDeleteSendFileSendPhotoSendVoiceSendInputSendSelectSendMultiSelectSendStatusFinishStatusSave。Options 包含 WithHTTPClientWithPollTimeoutWithSendTypeWithStatusEmojiWithStatusSendType

Discord

提供 SendDeleteSendFilesSendVoiceSendInputSendSelectSendMultiSelectSendStatusFinishStatusSaveWithStatusEmoji 用於設定 status reaction。

LINE 與 TTS

LINE 除生命週期與 Reply 外,提供 SendSaveWithPath 設定 webhook route。TTS 提供 Get(ctx, apiKey, text) ([]byte, error)

EN