televerse 2.4.0-dev.1
televerse: ^2.4.0-dev.1 copied to clipboard
Televerse lets you create your own efficient Telegram bots with ease in Dart. Supports latest Telegram Bot API - 8.3!
2.4.0-dev.1 #
- Minor lint supression - excluded generated files being anlyzed.
2.4.0-dev.0 #
- All Telegram Models are now built with Freezed.
- Breaking:
Keyboard&InlineKeyboardusage. Check this PR comment for details.
2.3.0 #
- π€ Bot API 8.3
- Check the Telegram Bot API changelog for detailled change info.
2.2.0 #
- π€ Bot API 8.2
- Added the methods
verifyUser,verifyChat,removeUserVerification, andremoveChatVerification, allowing bots to manage verifications on behalf of an organization. - Added the field
upgrade_star_countto the classGift. - Added the parameter
pay_for_upgradeto the methodsendGift. - Removed the field
hide_urlfrom the classInlineQueryResultArticle. Pass an empty string asurlinstead.
2.1.1 #
- Updated switch statements to Switch expressions.
- Fix:
BackgroundTypeType.chatThemetypo
2.1.0 #
- π€ Bot API 8.1
- Added class
AffiliateInfoand reflected all the changes from Bot API 8.1
2.0.2 #
- π Supports Middleware chaining for each handler.
- β οΈ Updated Conversation API definitions.
- π Conversation API migration guide is available at website.
- Updated
Fetcherimplementations. - Improved error wordings.
- Refactored
bot.dart - β οΈ Removed
Bot.onmethod &TeleverseEventenum.
2.0.1 #
- [Retracted]
2.0.0 #
- [Retracted]
1.28.0 #
- π€ Bot API 8.0
- Updated
RawAPI.createInvoiceLinkto the docs. - Updated
SuccessfulPayment,TransactionPartnerUserto reflect the new Star Subscription features. - π Added new API Methods -
editUserStarSubscription,setUserEmojiStatus,savePreparedInlineMessage,getAvailableGifts,sendGift. - π Added new classes -
PreparedInlineMessage,Gift,Gifts.
1.27.3 #
- β οΈ Removed
baseURLfromBotprimary constructor. - This is to rigidly separate
Bot.localagainstBotconstructors. Why do we need to keep two copies of the same thing? - From now on, local bots must be constructed using
Bot.local. - If you weren't using the local bot API, this change won't affect you.
1.27.2 #
- Fix: Base URL wasn't even being considered.
- Thanks to @itsmhmd for reporting
- Updated Request URI construction logic
- β οΈ Breaking! Removed
APIScheme. Now the scheme must be added to thebaseURLitself. - If you weren't using the local bot API, this change won't affect you.
1.27.1 #
- Fix
RawAPI.sendPaidMediacrashes while sending local file usingInputFile.fromFile
1.27.0 #
- π€ Bot API 7.11 π
1.26.7 #
- Fix in
Context.hasCallbackQuery
1.26.6 #
- Check
Webhook.secretTokenwith the headerX-Telegram-Bot-Api-Secret-Tokenbefore processing the incoming webhook update.
1.26.5 #
- Fix typo in
ReactionTypeCustomEmoji.customEmojiId
1.26.4 #
- Added
LocalFileclass. - Redefined
Payload.filesparameter with theLocalFileobjects instead ofMultipartFilefrom Dio.
1.26.3 #
- π Fix: Webhook Bots crashed when an invalid body was present in the request.
1.26.2 #
- Added way too many internal changes.
- Added separate method for
RawAPIconstruction inBot RawAPIinstance will be created along withBotinstance.- π Not having above caused transformers to not work. So obviously, fixed that.
- Added more
Contexthelper methods. - (Internal)
Bot._apiis now non-nullable. - (Internal) Properties
_loggerOptions,_baseURL, and_schemehas been removed fromBot. They now solely belong toRawAPI. - (Internal) Expensive calls are cached in
Context, such aschat,msgare now cached for better performance in recurring access.
1.26.0 #
- [β οΈ Breaking | Plugins] Updated the
Transformerclass - Made the
payloadparameter for theTransformer.transformmethod optional-positional argument. - Added
RawAPI.callmethod for independently calling the Telegram Bot API methods.
1.25.0 #
- π€ Bot API 7.10
- Added
Bot.onPaidMediaPurchasefor listening to PaidMediaPurchased updates. - Added much more helper methods on
Context
1.24.0 #
- π€ Bot API 7.9
- Added new methods
- Published Televerse Documentation website (https://televerse.xooniverse.com)
1.23.1 #
- Exposed couple of more properties in Context
- Added
Bot.additionalInfo - Documentation website is up.
1.23.0 #
- π€ Bot API 7.8
- Added
User.hasMainWebApp - Support for managing pinned messages on behalf of user (Business Bots)
1.22.5 #
- Just a re-release to move the repo to @Xooniverse
1.22.4 #
- Retracted :)
1.22.3 #
1.22.2 #
- Retracted
1.22.1 #
- Fixed an issue with the
InlineQueryResultGifclass - Made the bot initalization method public with
Bot.initmethod. - Updated the examples page
1.22.0 #
- π€ Bot API 7.7
- Added the
RefundedPaymentclass and theMessage.refundedPaymentproperty - Initalizes fetcher on the constructor
- Moved the inital
getMecall to be made from hteBot.startmethod - Remoed Pending Calls (which caused some troubles in the handler scopes order)
- Removed forked handlers, - well who knew it was there?
- All thanks to @im-trisha
- Fixed an issue that caused Bot to listen to the official Bot API even though
created with
Bot.local- #275 (Thanks to @devdocs for reporting) - Fixed #274
- Fix #277
- Fix #104
- Fixed more typing issues.
Bot.startnow accepts zero parameters.- Added
Context.maybeIda nullable ID instance
1.21.1 #
Webhooknow accepts ashouldSetWebhookflag which indicates whether thesetWebhookcall to be made implicitly or not.- Made the
urlproperty optional in Webhook. - Minor tweaks
1.21.0 #
- π€ Bot API 7.6
- Added methods to register callbacks for handling paid media in bot messages:
Bot.onPaidMedia: Registers a callback for whenever any type of paid media is received in messages.Bot.onPaidMediaVideo: Registers a callback for whenever paid media videos are received in messages.Bot.onPaidMediaPhoto: Registers a callback for whenever paid media photos are received in messages.
- New method
RawAPI.sendPaidMediais added to send paid media.
1.20.0 #
- π₯³ Support for Custom Context
- Added detailed usage documentation for custom context here.
- The custom context feature allows you to extend the base functionality of your bot by using your own custom context classes.
- Added
Bot.contextBuildermethod - Refactors across the library to cope with
<CTX extends Context>- Refactored
Bot,Handler,Fetcher,Menu,BotError,Conversationetc.
- Refactored
- Fixed an issue in
KeyboardMenuthat caused some features not to work. - Added documentation on almost all new classes and typedefs.
1.19.5 #
- π§π»βπ§ Fix in
InlineQueryResultBuildermethodsvoiceandvideo. - Improved
Webhookimplementation. Works perfect now! - Added example for building bot with
Webhookfetcher in Examples Repo - Added detailed documentation for
InlineQueryResultBuilderandWebhookclasses.
1.19.4 #
- Minor README fix
- Fixes in documentation comments
1.19.3 #
- Changed return type of the
Transformer.transformfromFutureOr<Map<String, dynamic>>toFuture<Map<String, dynamic>>because it'll always have to return a Future. - Minor type adjustment on the
typedef PayloadFiles. - β¨ Two new plugins are released for Televerse: auto_chat_action and parse_mode_setter
1.19.2 #
- β οΈ Changed the
Transformer.transformmethod definition. - Improved the
Transformerclass - Added new class
Payloadto accept payload to the API calls - Added typedef
APICallerfor the method which actually invokes the API endpoinds.
1.19.1 #
- π Support for Middlewares & Transformers
- Middlewares lets you attach handlers that are run before your main handler is executed.
- Added
Middlewareclass to create a middleware. - Added
Transformerclass to create a transformer. - A Transformer can be attached to the
RawAPIwhich then can alter the request payload. - Added
usemethod onBot,ContextandRawAPIto attach middlewares. - Added default error handler method. Now, bot will crash with a pretty message.
- Added
Context.middlewareStorageas aMap<String, dynamic>to store any output from middleware functions. - βοΈ
Bot.onStopmethod can now be asynchronous. #257 (Thanks to @devsdocs) - β οΈ Type of
Webhook.certificateis changed to InputFile as described by the official documentation. - Added examples for Middleware and Transformer usage in Examples repo.
1.19.0 #
- [Retracted]
1.18.0 #
- π€ Bot API 7.5
- Improved context aware methods
- Added
WithIDabstraction
1.17.2 #
- Added
considerCaptionparameter inBot.commandmehtod to match commands in the caption of video/photo messages. - π Fixed: JSON parsing bug in
UsersSharedcausing theusersfield to be null and resulting in crashes.
1.17.1 #
- βΌοΈ Strict typing for
ctx.editMessageMediaandctx.editMessageReplyMarkup - Fix:
ChatIDconstuctor accepteddynamic
1.17.0 #
- π€ Bot API 7.4 (May 28, 2024)
- Refactors and formatting improvements
1.16.0 #
- π€ Bot API 7.3 (May 6, 2024)
- Added
Keyboard.removemethod to remove Keyboard. - Refactors and improvements
1.15.14 #
- Removed unnecessary print in the callback setter.
- Fixed
BotLinklink generation.
1.15.13 #
- Removed usage of
dart:mirrors - Updated README
1.15.12 #
- Fix: Forked Handlers caused crash.
1.15.11 #
- Minor fix in update processing
- Added
businessConnectionIdto Context aware methods.
1.15.10 #
- Added
Bot.fromAPIconstructor for creating Bot instance fromRawAPIinstance. Bot.command,Bot.text,Bot.hears, and many more methods now listens to all Message types (Message, Channel Posts, and edited messages of both)- β οΈ Added
chatIdparameter toBot.shippingQueryandBot.preCheckoutQuery. - Refactored code for quality and better readability and added docs.
- Added
ScopeOptionsclass that can contain additional info for handler scope. ScopeOptions.forkedto create forked handlers. Forked handlers are run without conditions.ScopeOptions.customPredicatecan be used to set a middleware to check if the update should be processed or skipped.- Migrated to
Dart 3.0.0 Bot.removeScopecan be used to remove already set handlers.- Accepts
ScopeOptionon both menus as well.
1.15.9 #
- Improved efficiency by removing redundant
getMecalls while registeringcommandhandlers andwhenMentionedhandlers. - Made
LongPolling.allowedUpdatesnullable, and removed the constant empty list initialization. - Updated the README.
1.15.8 #
- Introducing
TGExceptionenum which is a collection of different possible Telegram exceptions binded with their reasons and possible solutions. - Added
LoggerOptions.onlymethod to turn on logging for ONLY specified actions. - Prints resposne data if any on exception with Logger.
- Prints
StackTracealong with uncaughtTelegramExceptionerrors.
1.15.7 #
Context.argswill no longer return null.- β οΈ Updated
RawAPIconstructor - Updated DartDoc comments for the
Bot.commandmethod. - Added new methods to
Keyboardfor simplicity.
1.15.6 #
- Added missing methods in the
InlineKeyboard
1.15.5 #
- Completes the helper class
MessageContentGeneratorfor ease of use to createInputMessageContent. - All types of InputMessageContent can be now generated with the new
MessageContentGeneratormethodstext,location,venue,contactandinvoice. - Updated README, and added an example for handling inline queries.
1.15.4 #
- π
InlineQueryResultBuilderutility class is added - The
InlineQueryResultBuildercan be used to build Inline Query Results in a better and easier way. - Made
callback_datarequired forInlineMenu.text - π¨π»βπ§ Fix
createNewStickerSet(Thanks to @defuera for pointing out the issue.) - Removed unnecessary JSON encodings
- Improved
LoggerOptionsand logging the requests and responses. - Refactors around
ForceReply,ChatMember, etc.
1.15.3 #
- Fix
InputStickerconversion to json π€¦ (thx @defuera)
1.15.2 #
- Add missing field
InputStickerFormattoInputStickerclass. (Thanks to @defuera) - Generic typing removed for
HandlerScope(This doesn't affect anything on the public API)
1.15.0 #
- π€ Bot API 7.2!
- All changes from the Bot API 7.2 is added to this release.
- Added the methods
Bot.onBusinessConnection,Bot.onBusinessMessage,Bot.onBusinessMessageEdited,Bot.onBusinessMessageDeletedto handle business messages and connection related updates. - Added
Context.businessConnection,Context.businessMessage,Context.editedBusinessMessage,Context.businessMessageDeletegetters to get the business connection, business message, edited business message, and business message delete updates respectively.
1.14.0 #
- π Whole new version of
TeleverseMenu - Both
InlineMenuandKeyboardMenuare now can be used to create menus with all available button types. - βΌοΈ BREAKING: Removed the
Session,SessionManager, and all Televerse Session related methods and properties. - Refactored the Unix Time to DateTime conversion.
1.13.4 #
- Added a new property
timeouttoBotandRawAPIclasses to set the timeout for the API requests. - The timeout does not affect the long polling (getUpdates) requests.
- Added
TeleverseExceptionTypeto categorize the exceptions that can be thrown from the Televerse library. - The
TeleverseExceptionclass now has atypeproperty to represent the type of the exception. - Added
RawAPI.closeClientmethod to close the HTTP client. - Removed the
HttpClientexport.
1.13.3 #
1.13.2 #
- π€ Bot API 7.1 is here.
- Refer to official changelog here.
1.13.1 #
- Improved the
ConversationAPI to make it easier and more efficient to use. - Added the parameter
clearUnfulfilled(true by default) to allwaitFormethods in Conversation which will clear the unfulfilled Conversation listeners when new one is attached. - Added
Conversation.clearandConversation.clearAllmethods to clear attached listeners. - All conversation method now return nullable
Contextobject, this is because when clearing the unfulfilled listeners, the method will returnnull. - Added
ConversationExceptionclass to represent the exceptions that can be thrown from theConversationclass. For now, the only exception that can possibly be thrown is the Timeout Exception.
1.13.0 #
- All Televerse listeners are now based on the single
Contextclass. - Removed all the different
Contextsubclasses, such asMessageContext,InlineQueryContext,CallbackQueryContextetc. - Added context-aware methods for almost all the methods in the
RawAPIclass. Conversation.waitFormethods no longer accepts generic type. All the methods return theContextclass.
1.12.7 #
- Now Televerse uses
APIMethodinstead of hard coded strings to call API endpoints. - Cleared missing
APIMethodimplementations and typos. - Cleaned up the code.
1.12.6 #
- Updated Example File
1.12.5 #
- Added
IDparameter totoJsonof manyInlineQueryResultclasses.
1.12.4 #
- Implemented
MessageOrigin.fromJsonwhich was part of the Bot API 7.0
1.12.3 #
- Made almost all models to have const constructors
Bot.inlineQuerymethod is updated to acceptPattern queryto listen to inline queries that match the passed pattern. It had an unintended behavior before.- Updated
toStringonInlineQueryResultTypeenum for it to work withRawAPI.answerInlineQuery
1.12.2 #
- Fixed an issue with the
InlineKeyboardButtonclass that caused a crash whenwebAppInfoparameter is set. (#190)
1.12.0 #
- Bot API 7.0 (December 29, 2023)
Reactions! π #
- New Context objects,
MessageReactionContext&MessageReactionCountUpdatedContextto representmessage_reactionandmessage_reaction_countupdates respectively. - Added
Televerse.onMessageReactionandTeleverse.onMessageReactionCountmethods to listen tomessage_reactionandmessage_reaction_countupdates respectively. - π Added methods
MessageContext.reactandMessageContext.reactMultipleto react to a message. - π Added
Televerse.whenReactedmethod to listen to particular reactions on a message.
Replies 2.0 π― #
- β οΈ BREAKING: Replaced all usages of
replyToMessageIdandallowSendingWithoutReplyparameters withreplyParametersof TypeReplyParameters. - β οΈ Affected methods on
RawAPI:copyMessage,sendMessage,sendPhoto,sendVideo,sendAnimation,sendAudio,sendDocument,sendSticker,sendVideoNote,sendVoice,sendLocation,sendVenue,sendContact,sendPoll,sendDice,sendInvoice,sendGame, andsendMediaGroup. - β οΈ Affected methods on
MessageContext:reply,replyWithPhoto,replyWithAudio,replyWithDocument,replyWithVideo,replyWithVideoNote,replyWithVoice,replyWithMediaGroup,replyWithLocation,replyWithVenue,replyWithContact,replyWithPoll,replyWithDice,replyWithGame,replyWithAnimation,replyWithSticker.
Link Preview Customization π #
- β οΈ BREAKING: Replaced the parameter
disableWebPagePreviewwithlinkPreviewOptionsin the methodsRawAPI.sendMessageandRawAPI.editMessageText. - β οΈ Affected methods on Televerse:
ChatJoinRequestContext.replyToUser,ChatMemberUpdatedContext.replyToUser,CallbackQueryContext.editMessage,MessageContext.reply, andMessageContext.editMessageText. - β οΈ BREAKING:
InputTextMessageContent.disableWebPagePreviewis now renamed toInputTextMessageContent.linkPreviewOptionsand the type is changed toLinkPreviewOptions.
Multiple Message Actions π¨ #
- Added
deleteMessages,forwardMessages, andcopyMessages
Request for multiple users πββοΈ #
- β οΈ BREAKING:
KeyboardButton.requestUseris now renamed asKeyboardButton.requestUsersand the type is changed toKeyboardButtonRequestUsers. - Renamed the class KeyboardButtonRequestUser to KeyboardButtonRequestUsers and added the field max_quantity to it.
- Renamed the field
request_userin the class KeyboardButton torequest_users. - Added the class
UsersShared. - Replaced the field
user_sharedin the class Message with the fieldusers_shared.
Chat Boosts π #
- π New methods to listen the
ChatBoostUpdatedandChatBoostRemovedupdates, respectivelyTeleverse.onChatBoosted,Televerse.onChatBoostRemovedare added. - π New context objects
ChatBoostUpdatedContextandChatBoostRemovedContextare added.
Other Changes π #
- Updated
Chatmodel to reflect the changes in the API. - β οΈ BREAKING: Added the class
MessageOriginand replaced the fieldsforward_from,forward_from_chat,forward_from_message_id,forward_signature,forward_sender_name, andforward_datewith the fieldforwardOriginof typeMessageOriginin the classMessage. - β οΈ BREAKING:
CallbackQuery.messageis now of the typeMaybeInaccessibleMessageinstead ofMessage.
1.11.5 #
- Made the parameters inside
OrderInfoclass nullable as per the documentation. - Thanks to @Defuera for the contribution.
1.11.4 #
- Refactored the code to make it easier to maintain.
- Added
lintsas a dev dependency.
1.11.3 #
1.11.2 #
- Fixed an issue with the
InlineKeyboardButtonclass that caused a crash whenwebAppInfoparameter is set. - Moved all Telegram Models into one file. This will make it easier to maintain the code.
1.11.1 #
- π€ Telegram Bot API 6.9 (September 22, 2023)
- Examples are now moved to the Examples Repo
- Updated Example files.
1.11.0 #
- π€ Telegram Bot API 6.8 (August 18, 2023)
- Possibly breaking: The
PollAnswer.userproperty is now returns a nullableUserobject.
1.10.12 #
- Using
LoggerOptionsunknowingly caused the bot to crash. This is now fixed. - Thanks to @iamcosmin for raising #148.
- Fixed an issue with the Http client that caused the bot to crash when an exception is received from the Telegram Bot API.
- Thanks to @OttomanDeveloper for raising #151.
- Added
Televerse.onCommandmethod to listen to all commands - #150 by @Defuera.
1.10.10 #
- Added
LoggerOptionsclass to configure the logger. - Now the
Televerseclass accepts aLoggerOptionsobject to setup logging requests and responses to and from the Telegram Bot API. - Added the
APIMethodenum to represent the Telegram Bot API methods. - You can pass the List of
APIMethodto theLoggerOptionsclass to log only the specified methods. By default all methods will be logged.
1.10.9 #
- Added
Televerse.setNextStepmethod which can be used to set next step handler. - Catches
DioExceptionsand throws meaningful exceptions.
1.10.8 #
- β οΈ BREAKING CHANGES
- Added
BotErrorclass that will be passed to theTeleverse.onErrorhandler - β οΈ
Televerse.onErrorwill now only accept one parameter which is instance ofBotError - β οΈ Made the
InputFileconstructor private. UseInputFile.fromFileorInputFile.fromBytesorInputFile.fromUrlorInputFile.fromFileIdto create anInputFileinstance. - π Added the
InputFile.fromBytesconstructor to create anInputFileinstance from aUint8Listobject. - βοΈ Migrated to
dioinstead ofhttppackage. - Refactors & tets
1.10.7 #
- Fixed a minor formatting issue
1.10.6 #
- Fix #135 - Methods in
MessageContextfailed to work when message is in a General Topic of a Forum. - Improved error handling.
- All exceptions thrown inside handler methods will now be caught and passed to
the
onErrormethod. - That is no more unexpected crashes even if you don't handle the exceptions inside the handler methods.
- Removed some unnecessary code.
- Updated long polling error handling.
1.10.4 #
1.10.3 #
- Introducing
Televerse Menu. - Added
InlineMenuandKeyboardMenuclasses to represent an inline menu and a keyboard menu respectively. - Added
bot.attachMenumethod to attach a menu to the bot. - Added
bot.removeMenumethod to remove a menu listeners from from the bot. - Usage of
Televerse Menuis demonstrated in /example/menu_bot.dart. - Fixed an issue with the
MessageContextandMessageMixin- #124 - Improved code quality.
- Fixed the incorrect type of
messagThreadIdparameter in multiple methods. - Updated
ChatMemberUpdatedContextclass to support bothchat_memberandmy_chat_memberupdates. - Added
bot.megetter to get the information about the bot. (Thanks to @GiuseppeFn) - Added
bot.getMemethod to get the information about the bot and set it to thebot.megetter.
1.10.2 #
1.10.1 #
- Fixed an issue with the
commandmethod that crashed the bot when setting up the listener. - Thanks to @GiuseppeFn for reporting this issue.
- Refactored code for better performance.
1.10.0 #
- Introducing the
Televerse Conversation! π - The conversation API lets you create straight forward conversations with the users.
- Added
Conversationclass to represent a conversation. - Added
waitForTextMessage,waitForPhotoMessage,waitForVideoMessage,waitForVoiceMessage,waitForDocumentMessage,waitForContactMessage,waitForLocationMessage,waitForVenueMessage,waitForPollMessage,waitForDiceMessage,waitForGameMessage,waitForStickerMessage,waitForVideoNoteMessage,waitToStartVideoChat,waitToEndVideoChat&waitForCallbackQuerymethods toConversationclass. - Added an example to demonstrate the usage of Televerse conversations in /example/conversation_example.dart.
- Added
MessageContext.argsgetter to get the arguments passed to the command. Thanks to @GiuseppeFn for the contribution. #115 - Removed
MessageContext.startParametergetter as it's no longer needed. - Refactored examples to make it easier to understand.
1.9.14 #
- Fixed a critical issue that caused bots to crash when an exception other than
TelegramExceptionis thrown. - The weird thing was that the
onErrormethod was able to catch the exception but it rethrows it again. - This is now fixed and the
onErrormethod will not rethrow the exception. - Thanks to @GiuseppeFn for raising this.
1.9.13 #
- Added a whole bunch of helper methods to listen to updates.
- Namely added:
onAudio,onDocument,onPhoto,onSticker,onVideo,onVideoNote,onVoice,onContact,onDice,onGame,onPollMessage,onVenue,onLocation,onLiveLocation,onNewChatTitle,onNewChatPhoto,onDeleteChatPhoto,onPinnedMessage,onUsrShared,onChatShared,whenVideoChatScheduled,whenVideoChatStarted,whenVideoChatEnded,onVideoChatParticipantsInvited,onForumTopicCreated,onForumTopicEdited,onForumTopicClosed,onForumTopicReopened,onWebAppData,onAnimation,onText,onCaption - All of these methods are available on
Televerseclass and can make it easier to listen to variousMessageupdates.
1.9.12 #
- Fixes the issue which caused the crash of bots when a
ChatJoinRequestupdate is received. - Thanks to @iamcosmin for taking effort to fix this issue. #109
- The
messageThreadIdparameter noww be defaulted to themessageThreadIdparameter in the incomingContextobject onreplymethod. - This is to make it easier to reply to a message when the discussion is on a Forum Topic. (Fixes #110)
1.9.11 #
1.9.10 #
- Fix #104
- When
onMessagelistener is attached it stopped all other listeners from working. This is now fixed. - Updated README (some typos).
1.9.9 #
- Fix #102
- Commands that tagged with
@botnamewill now be matched. - Minor changes on README & Session example.
1.9.8 #
- Televerse now can support handling updates passed to it as JSON data (without using a fetcher).
- This can be useful when you want to run bot on a serverless environment like AWS Lambda or Google Cloud Functions.
- Thanks to @rohitsangwan01 for the contribution. #99
onErrorcan now catch errors on the Long Polling.- Replaced all
ExceptionwithTelegramExceptionin the library. - Replaced the
Televerse.onlogic to an extension onTeleverseclass.
1.9.7 #
- Fix around
onErrormethod.
1.9.6 #
- Added
Televerse.onStopto listen when the bot is stopped. (Fix #95) - Added
delayDurationparameter toLongPollingclass to set the delay duration between each long polling request. - Moved all methods in
SessionFileExtensionandSessionsSavertoSessionandSessionsManagerclasses respectively. - This is to simplify the API and to make it easier to use.
- Updated
httpdependency to^1.0.0.
1.9.4 #
- Added
SessionFileExtensionclass to represent a file extension. - Added
SessionsSaverextension onSessionsManagerclass to save all sessions to a directory. - Updated /example/session_bot.dart file to reflect the changes.
- Minor breaking change: the initializer function now should accept a
intas parameter.
1.9.3 #
- Fixed an issue with sessions that caused crash when not initialized.
1.9.2 #
- Introducing the
Televerse Session! π - Televerse sessions are used to store data for chats.
- This can be used to store data for chats and to make the bot more interactive.
- Added an example to demonstrate the usage of Televerse sessions in
/example/session_bot.dart. - You should use the
Televerse.initSessionmethod to initialize the session.
1.9.1 #
- Added the
Televerse.onmethod! π - Removed the deprecation warning from the
Televerse.onmethod.
1.9.0 #
- BREAKING CHANGES! β οΈ
- Whole new
HandlerScopeclass is added to make it efficient handle updates. - All the methods in the
Televerseclass now uses theHandlerScopeclass to register handlers. - This is to fix the issue #84 and to make it efficient to handle updates.
- Completely removed the
Eventclass and related methods and getters. - The
onmethod is now Deprecated. Use the other methods in the library to listen for updates. - All the getters in the
Eventclass is now added to theTeleverseclass as methods. - Televerse now relies only on the
onUpdatestream to listen for updates. - And all the errors can now be handled using the
onErrormethod.
1.8.6 #
- Added
UserLinkclass to represent a Telegram user link. - Added
LinkTextclass. This can be used to send a link with a custom text on chats. - Fixed an issue with the
Televerse.commandthat caused to match unexpected commands.- This was because the
Televerse.commandmethod usedString.startsWithto match the command. - Thanks to GiuseppeFn for raising the Issue #85
- This was because the
- The
HttpExceptionclass is now renamed toTelegramException. - This is to include the
ResponseParametersobject in the exception hence to make it easier to handle and retry if needed. - When an exception happens in the long polling, if the error handler is set
using
Televerse.onErrormethod this will now pauses the long polling till theonErrorhandler completes its execution.
1.8.5 #
- Added the
Deeplinkclass to represent a Telegram deeplink. - Made it easy to use Telegram deeplinks by adding
BotLink,GroupBotLink,ChannelBotLink,GameLink,SettingsLinksandShareLinkclasses. - Also added
PhoneNumberLink,MTProxyLink,Socks5LinkandUsernameLink.
1.8.4 #
- β¨ Simplified mentions.
- Added the new
UserMentionclass to represent a user mention. - Added an extension to
Userclass to convert it to aUserMentionobject. - Added
MessageContext.fromalias toMessage.fromproperty. - Added
CustomEmojiclass to represent a Telegram custom emoji.
1.8.3 #
- Added more helper methods on
Televerseclass to listen to updates. - Added
Televerse.onURLmethod to listen to messages that contain URLs. - Added
Televerse.onHashtagmethod to listen to messages that contain hashtags. - Added
Televerse.onMentionmethod to listen to messages that contain mentions. - Added
Televerse.onEmailmethod to listen to messages that contain email addresses. - Added
Televerse.onPhoneNumbermethod to listen to messages that contain phone numbers. - Improved the overall code quality.
- Added
Televerse.whenMentionedmethod to listen to messages that contain mentions of the bot.
1.8.2 #
- Added
PollContext,PollAnswerContextclasses to represent the context of apollandpoll_answerupdates. - Added
Televerse.pollmethod to listen topollupdates. - Added
Televerse.pollAnswermethod to listen topoll_answerupdates. - Now most of the Televerse methods return a
StreamSubscriptioninstead ofvoid. - This is to make it easier to cancel the subscription and increase the performance.
- Added
ChosenInlineResultContextclass to represent the context of achosen_inline_resultupdate andTeleverse.chosenInlineResultmethod to listen tochosen_inline_resultupdates. - Added
ChatJoinRequestContextclass to represent the context of achat_join_requestupdate andTeleverse.chatJoinRequestmethod to listen tochat_join_requestupdates. - Added
ShippingQueryContextclass to represent the context of ashipping_queryupdate andTeleverse.shippingQuerymethod to listen toshipping_queryupdates. - Added
PreCheckoutQueryContextclass to represent the context of apre_checkout_queryupdate andTeleverse.preCheckoutQuerymethod to listen topre_checkout_queryupdates.
1.8.1 #
- Added
ChatMemberUpdatedContextclass to represent the context of achat_memberandmy_chat_memberupdates. - Added
Televerse.chatMemberandTeleverse.myChatMembermethods to listen tochat_memberandmy_chat_memberupdates. - Hot fix: Fixed an issue with the
Eventclass that caused unexpected exceptions.
1.8.0 #
- ποΈ Televerse now supports listening to Local Bot API Server.
- Added
Televerse.localmethod to create a bot instance that listens to a local Bot API Server. - Added
RawAPI.localmethod that can be used to createRawAPIinstance that targets a local Bot API Server. - Added
LongPolling.allUpdatesmethod to listen to all updates. This is to simplify listening to all updates including thechat_memberupdates. - Updated
/example/test_bot.dartfile to reflect the changes.
1.7.2 #
- [BREAKING] β οΈ - The
chatgetter on theChatIDclass is now replaced to be a method of theIDclass, and renamed toget(). - This is to avoid confusion with the
chatparameter in theChatIDclass. - Also, now the
get()method is available on all theIDclasses -ChatID,SuperGroupIDandChannelID. - Fixed an issue that caused the Long Polling to fail.
- The issue was with the
Message.fromJsonmethod which was not able to parse theMessageobject when anewChatPhotowas present. - Thanks to @deargosep for reporting and fixing this issue.
1.7.1 #
- [BREAKING] β οΈ - The parameters
nameandlanguageCodeare made positional in thesetMyNamemethod and thegetMyNamemethod. - Improved documentation.
1.7.0 #
- π€ Bot API 6.7 is added!
- Read more here.
- [BREAKING] π¨π»βπ§ - The
answerInlineQuerywill no longer acceptswitchPmParameterorswitchPmTextparameters. - The example files are updated with dartdoc comments.
1.6.0 #
- βοΈ BREAKING - The
allowedUpdatesparameter in theLongPollingobject now accepts the list ofUpdateTypeinstead ofString - Added methods
requestChatandrequestUserinKeyboard - Added equality operator (
==) onID. - Added a test to check equality of two Chat IDs.
- Added missing implementation for
WebhookInfo.toJsonmethod - Added dartdoc comments for almost every bit of the library.
1.5.6 #
- Fixed an issue with
RawAPI.copyMessagemethod. - Updated the
Televerse.commandmethod to accept aStringorRegExpas thecommandparameter.
1.5.5 #
- Changed the
dataparameter to accept bothStringandRegExpusingPatterntype onTeleverse.callbackQuerymethod. - This can simplify the code when you want to listen to a callback query with a specific data.
- The test_bot.dart file in the example folder has been updated to reflect this change.
1.5.4 #
- Added new test cases in the
/testfolder. - There were some
thumbparameters even though they were changed tothumbnailin the API documentation. Fixed that. - Fixed an issue with sending media group using local files. More info on #56
- Completely removed the class
MessageOrBooleanas it was not needed. All methods that return either aMessageor aboolnow split into two methods. One forMessageand one forbool. - Updated the
ReplyKeyboardRemoveclass to reflect auto set theremove_keyboardparameter totruewhen theReplyKeyboardRemoveclass is created. - Similarly, updated the
ForceReplyclass to reflect auto set theforce_replyparameter totruewhen theForceReplyclass is created. - Fixed an issue with
addStickerToSetmethod which caused it to fail. More info on #57. - Tested all methods related to Stickers.
- Fixed an issue with
createNewStickerSetmethod which caused it to fail. More info on #58.
1.5.3 #
- Fixed an issue with
RawAPI.sendAudiomethod. - Added new test files in example folder.
1.5.2 #
- More fixes around the
RawAPIclass. - Added missing implementations for
RawAPI.getCustomEmojiStickersmethod.
1.5.1 #
- Fixed an issue with the
RawAPI.sendChatActionmethod. - More fixes around the RawAPI class.
1.5.0 #
- π€ Bot API 6.6 (March 9, 2021) π
- A bunch of changes as per the Bot API 6.6
1.4.7 #
- Added
Televerse.entitymethod to listen to entities in messages. - Improved code quality.
- Removed all the different StreamController classes and replaced them with a
single
StreamController<Update>instance. - All the event streams are now based on the
onUpdatestream. - Added
Message.getEntityTextmethod to get the text of the entity. - Updated the televerse_example file to reflect the changes.
1.4.6 #
- Added
Message.isCommandgetter to check if the message is a command. - Added
Televerse.onErrormethod to listen to unexpected exceptions.
1.4.5 #
- A bunch of refactors on the
onmethod.
1.4.4 #
- Added
TeleverseEvent.commandto listen to all commands.
1.4.3 #
- Added helper methods on
Fileclass to get the file download URL, download URI, file bytes, and finally to download the file. - Added
File.downloadmethod to download the file. - Added
File.getDownloadUrlmethod to get the file download URL asString. - Added
File.getDownloadURImethod to get theUriobject of the file download URL. - Added
File.getBytesmethod to get the file bytes this returns aFuture<Uint8List>. - Added
File.downloadmethod to download the file. This returns aFuture<io.File>object. - The working example is available at examples/file_download.dart
1.4.2 #
- Fixed an issue with the webhook configuration.
- Made it easier to set a custom fetcher. You don't have to pass the
RawAPIinstance to theFetcherconstructor anymore.
1.4.1 #
- Minor formatting changes.
1.4.0 #
- π₯ This is breaking change.
- Added the
RawAPIclass to access the raw Telegram Bot API methods. - Added a
apigetter toTeleverseclass to access theRawAPIclass. - Now it's even easier to access and differentiate between the Telegram Bot API methods and Televerse methods.
- Added dartdoc comments to all the classes.
1.3.1 #
- Added shorthand methods to setup listners for
/start,/help,/settingscommands. - You can now use
Televerse.start,Televerse.help, andTeleverse.settingsto listen for these commands. - All these methods accepts a
MessageHandleras a parameter which is a type alias forFutureOr<void> Function(MessageContext). - Added
MessageHandler,CallbackQueryHandler, andInlineQueryHandlertype aliases.
1.3.0 #
- Telegram Bot API 6.5 (February 3, 2023)
- This includes addition of classes like
KeyboardButtonRequestUser,KeyboardButtonRequestChat,UserSharedandChatShared. - Added some missing implementations for Bot API 6.4
1.2.6 #
- Added
Televerse.instancegetter to get the last instance ofBotcreated. - Added
ChatID.chatgetter to get theChatobject from theChatIDobject. - Added optional
RegExp? regexparameter toTeleverse.commandmethod.
1.2.5 #
- Added
startParametergetter toMessageContextclass. This will be automatically set when the bot is started by a user clicking on a deep link such ast.me/MyBot?start=12345. - Added more tests.
- Whole lot of refactoring.
1.2.4 #
- New
InlineKeyboardclass is added. This can be very useful in creatingInlineKeyboardMarkup. - New
Keyboardclass to help with creatingReplyKeyboardMarkupeasily and quickly. - Updated
ReplyKeyboardMarkupandKeyboardButtonas per the API Documentation (some of the optional parameters were required in the previous version). - Fixed an issue that was causing
sendMessageto not work when used with any reply markup.
1.2.3 #
- Added documentation for all most all classes and Televerse things.
1.2.2 #
- Added
MessageMixinto supportMessageContext. - Added
replyWithPhoto,replyWithVideo,replyWithAudio,replyWithDocument,replyWithVideoNote,replyWithVoice,replyWithVenue,replyWithContact,replyWithPoll,replyWithDice,replyWithChatAction,replyWithGame,replyWithAnimation,replyWithSticker,editMessageText, anddeleteMessagemethods toMessageContext. - Added
ManagementMixinto supportMessageContext. - Added
banAuthor,banSenderChat,deleteChatPhoto,promoteAuthor,restrictAuthor,exportChatInviteLink,revokeChatInviteLink,pinChatMessage,unpinChatMessage,getChat,getChatAdministrators,getChatMember, andleaveChatonManagementMixin. - Both
MessageMixinandManagementMixinare now available onMessageContext. - Added
CallbackQueryMixinto supportCallbackQueryContext. CallbackQueryContextnow hasanswerandeditMessagemethods available.- Added
InlineQueryMixinto supportInlineQueryContext. InlineQueryContextnow hasanswer, andanswerWithArticlesmethods available.
1.2.1 #
- Fixed an issue with the
onmethod that it's not getting called on any filters. - Made official Televerse Wiki available at the GitHub repo.
1.2.0 #
- Added
TeleverseEventenum to make it easy to listen for particular events. - π₯ Added
onmethod accessible onTeleverseclass. This method can be used to listen for particular events as listed inTeleverseEventenum. - Edited method
Televerse.callbackQueryto acceptRegExp? regexas an optional parameter. This can be used to listen for callback queries that match the passed regex. - Updated RAW API to return
Messageinstead ofMessageContext. - Updated
Contextclass to have the associatedUpdateobject with it. - Update
MessageContextOrBooleanclass to beMessageOrBooleanin places a method sending eitherMessageorbool, such aseditMessageLiveLocationetc.
1.1.0 #
- Added a lot new methods to
Televerseclass:command- Can be used to listen for Messages that contain the passed commandtext- This is a very basic method, which can be used to listen to messages that contain particular text content in itcallbackQuery- Can be used to listen for callbackQuery updates.chatTypeandchatTypes- Can be used to register callbacks for messages received on particular chat types.filter- Filter is an advanced method that can be used to listen for messages that pass a given predicate condition.hears- One of the best picks. Users can pass a RegEx pattern and listen for messages that contain a match.
- Added
MessageContext.idto get the Chat ID easily - Improved examples
1.0.1 #
- Initial release
- We're live at Bot API 6.4
MessageContextclass added withreplymethod
0.0.1 #
- On development release. Completely new project.