v0.5.0

Removed APIs

Last updated


This page lists public symbols that no longer exist in go-bot, the version that removed them, and what to use instead.

v0.5.0: platform packages moved under core/


The telegram, discord, and line packages moved from the module root to core/. Every symbol below still exists with the same name and signature in the new package (except SendVoice, see the next section); only the import path changed.
Old package (last in v0.4.3)SymbolsStatusReplacement
github.com/pardnchiu/go-bot/telegramBot, ChatStatus, FileType, Input, MessageOption, New, Option, ReplyHandler, SendType, Status, StatusOption, WithHTTPClient, WithPollTimeout, WithSendType, WithStatusEmoji, WithStatusSendType; methods Close, Delete, FinishStatus, Reply, Save, Send, SendFile, SendInput, SendMultiSelect, SendPhoto, SendSelect, SendStatus, SendVoice, Start, StatusRemoved in v0.5.0github.com/pardnchiu/go-bot/core/telegram
github.com/pardnchiu/go-bot/discordBot, ChannelStatus, Input, New, ReplyHandler, Status, StatusOption, WithStatusEmoji; methods Close, Delete, FinishStatus, Reply, Save, Send, SendFiles, SendInput, SendMultiSelect, SendSelect, SendStatus, SendVoice, Start, StatusRemoved in v0.5.0github.com/pardnchiu/go-bot/core/discord
github.com/pardnchiu/go-bot/lineBot, Input, New, Option, ReplyHandler, Status, WithPath; methods Close, Reply, Save, Send, Start, StatusRemoved in v0.5.0github.com/pardnchiu/go-bot/core/line

  1. // before (v0.4.x)
  2. import "github.com/pardnchiu/go-bot/telegram"
  3. // after (v0.5.0+)
  4. import "github.com/pardnchiu/go-bot/core/telegram"

v0.5.0: tts package and text-based SendVoice


SymbolStatusLast versionReplacement
tts.Get(ctx, apiKey, text string) ([]byte, error) (Gemini text-to-speech, ffmpeg conversion to OGG/OPUS)Removed in v0.5.0v0.4.3No public replacement; generate the OGG/OPUS file with your own TTS service
telegram.SendVoice(ctx, chatID, text, apiKey, caption...)Signature changed, removed in v0.5.0v0.4.3SendVoice(ctx, chatID, path, caption...) in core/telegram
discord.SendVoice(ctx, channelID, replyTo, text, apiKey, caption...)Signature changed, removed in v0.5.0v0.4.3SendVoice(ctx, channelID, replyTo, path, caption...) in core/discord

The new SendVoice signatures end in caption ...string, so old calls still compile: the text is treated as a file path and the API key is posted as the caption. Check every SendVoice call by hand when upgrading.

中文