Releases: ShaneQi/ZEGBot
Lowered Swift Requirement to `5.0`
4.2.7 - Multipart Uploading
Now you can send resource (document, video, photo, etc) from a local file.
Completed All `MessageEntity` Types
underline
and strikethrough
types were missing from MessageEntity type enum, which has been causing parsing errors. Not it's fixed.
More Friendly to One-way Usage
By 'One-way Usage', I meant using ZEGBot to do stuff like sending messages without listening to updates. For some users, their bots don't care about what they receive, they only want to use the library to send content. An channel bot is a good example.
In this version:
AnyChat
andAnyMessage
were introduced so that you can send content to any chat or replay to any message as long as you have the chat id or/and message id. Previously, you have to run the bot to listen to updates to get theChat
orMessage
objects to send content.- Enum
ServerStoredContent.Location
(case telegramServer(fileId: String)
andcase internet(url: URL)
) were introduced to support sending content that's either on Telegram server (with the file id), or on the internet (with an url).
API break change, edit message text/caption methods and `Message.mediaGroupId`.
- API break change:
ZEGBot.run(withHandler:)
now accepts a block of handling MULTIPLEUpdate
objects, it used to accept a block of handling a singleUpdate
object. - Added edit message text method and edit message caption method.
- Added
Message.mediaGroupId
.
Adopted FoundationNetworking (New Module w/ Swift 5.1)
Swift 5
API Change Alert!
API change: methods that return Result<T>
objects are now changed to throws -> T
.
New supported methods:
- deleteMessage
- getChatAdministrators
- answerCallbackQuery
- restrictChatMember
- kickChatMember
Swift 4.1
NO DEPENDENCY!
Thanks to Swift 4.0, we have this shining new Codable
feature. And I love Codable
!
I removed the last dependency IBM-Swift/SwiftyJSON, embraced Codable
, and we don't have any dependencies anymore!
The only API change is:
UpdateHandler
now handles Result<Update>
. Which means that not only updates but also errors will be passed to the handler.