削除された API
最終更新
このページでは、go-bot にもう存在しない公開シンボル、それを削除したバージョン、代わりに使うものを一覧にしています。
v0.5.0: プラットフォームパッケージを core/ 配下へ移動
telegram、discord、line パッケージはモジュールのルートから core/ へ移動しました。以下のシンボルは、新しいパッケージでも同じ名前とシグネチャのまま存在します(SendVoice は例外で、次のセクションを参照)。変わったのは import パスだけです。| 旧パッケージ(最終は v0.4.3) | シンボル | 状態 | 代替 |
|---|---|---|---|
github.com/pardnchiu/go-bot/telegram | Bot, 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 | Removed in v0.5.0 | github.com/pardnchiu/go-bot/core/telegram |
github.com/pardnchiu/go-bot/discord | Bot, ChannelStatus, Input, New, ReplyHandler, Status, StatusOption, WithStatusEmoji、メソッド Close, Delete, FinishStatus, Reply, Save, Send, SendFiles, SendInput, SendMultiSelect, SendSelect, SendStatus, SendVoice, Start, Status | Removed in v0.5.0 | github.com/pardnchiu/go-bot/core/discord |
github.com/pardnchiu/go-bot/line | Bot, Input, New, Option, ReplyHandler, Status, WithPath、メソッド Close, Reply, Save, Send, Start, Status | Removed in v0.5.0 | github.com/pardnchiu/go-bot/core/line |
- // 変更前(v0.4.x)
- import "github.com/pardnchiu/go-bot/telegram"
- // 変更後(v0.5.0 以降)
- 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 への変換) | Removed in v0.5.0 | v0.4.3 | 公開された代替はなし。OGG/OPUS ファイルは自前の TTS サービスで生成する |
telegram.SendVoice(ctx, chatID, text, apiKey, caption...) | シグネチャ変更、Removed in v0.5.0 | v0.4.3 | core/telegram の SendVoice(ctx, chatID, path, caption...) |
discord.SendVoice(ctx, channelID, replyTo, text, apiKey, caption...) | シグネチャ変更、Removed in v0.5.0 | v0.4.3 | core/discord の SendVoice(ctx, channelID, replyTo, path, caption...) |
新しい
SendVoice のシグネチャは caption ...string で終わるため、古い呼び出しもそのままコンパイルできてしまいます。テキストはファイルパスとして扱われ、API キーはキャプションとして投稿されます。アップグレード時はすべての SendVoice 呼び出しを手作業で確認してください。