v0.5.0

已移除 API

最後更新


本頁列出 go-bot 已不存在的公開符號、移除的版本,以及替代做法。

v0.5.0:平台套件移入 core/


telegram、discord、line 三個套件從 module 根目錄移到 core/。下列符號在新套件中名稱與簽名都不變(SendVoice 除外,見下一節),只有 import path 改變。
舊套件(最後存在於 v0.4.3)符號狀態替代
github.com/pardnchiu/go-bot/telegramBot、ChatStatus、FileType、Input、MessageOption、New、Option、ReplyHandler、SendType、Status、StatusOption、WithHTTPClient、WithPollTimeout、WithSendType、WithStatusEmoji、WithStatusSendType;方法 Close、Delete、FinishStatus、Reply、Save、Send、SendFile、SendInput、SendMultiSelect、SendPhoto、SendSelect、SendStatus、SendVoice、Start、Status移除於 v0.5.0github.com/pardnchiu/go-bot/core/telegram
github.com/pardnchiu/go-bot/discordBot、ChannelStatus、Input、New、ReplyHandler、Status、StatusOption、WithStatusEmoji;方法 Close、Delete、FinishStatus、Reply、Save、Send、SendFiles、SendInput、SendMultiSelect、SendSelect、SendStatus、SendVoice、Start、Status移除於 v0.5.0github.com/pardnchiu/go-bot/core/discord
github.com/pardnchiu/go-bot/lineBot、Input、New、Option、ReplyHandler、Status、WithPath;方法 Close、Reply、Save、Send、Start、Status移除於 v0.5.0github.com/pardnchiu/go-bot/core/line

  1. // 之前(v0.4.x)
  2. import "github.com/pardnchiu/go-bot/telegram"
  3. // 之後(v0.5.0 起)
  4. import "github.com/pardnchiu/go-bot/core/telegram"

v0.5.0:tts 套件與文字版 SendVoice


符號狀態最後存在版本替代
tts.Get(ctx, apiKey, text string) ([]byte, error)(Gemini 文字轉語音,經 ffmpeg 轉成 OGG/OPUS)移除於 v0.5.0v0.4.3無公開替代;以自己的 TTS 服務產生 OGG/OPUS 檔
telegram.SendVoice(ctx, chatID, text, apiKey, caption...)簽名變更,移除於 v0.5.0v0.4.3core/telegram 的 SendVoice(ctx, chatID, path, caption...)
discord.SendVoice(ctx, channelID, replyTo, text, apiKey, caption...)簽名變更,移除於 v0.5.0v0.4.3core/discord 的 SendVoice(ctx, channelID, replyTo, path, caption...)

新的 SendVoice 簽名以 caption ...string 結尾,因此舊呼叫仍可編譯:文字會被當成檔案路徑,API key 會被當成 caption 發出。升級時請逐一人工檢查每個 SendVoice 呼叫。

相關頁面


EN