diff --git a/CHANGELOG.md b/CHANGELOG.md index db25659..021d382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 2.0.1 +# 2.0.2 - 🆕 Supports Middleware chaining for each handler. - ⚠️ Updated Conversation API definitions. @@ -6,7 +6,11 @@ - Updated `Fetcher` implementations. - Improved error wordings. - Refactored `bot.dart` -- ⚠️ Removed `Bot.on` method. +- ⚠️ Removed `Bot.on` method & `TeleverseEvent` enum. + +# 2.0.1 + +- [Retracted] # 2.0.0 diff --git a/example/README.md b/example/README.md index b4c55e8..e4a5996 100644 --- a/example/README.md +++ b/example/README.md @@ -67,17 +67,6 @@ void main() async { await ctx.reply("Oh wow, this is a big photo!"); }); - /// So with the [Bot.on] method you can listen for particular updates. Yeah, that indeed means - /// that you can listen for all commands simply by listening for the [TeleverseEvent.command] event. - bot.on(TeleverseEvent.command, (ctx) async { - await ctx.reply("This will be executed for every command unhandled"); - - // Do your logic here - if (ctx.message?.text == "/televerse") { - await ctx.reply("Much love from Televerse! ❤️"); - } - }); - /// You can also listen for particular message entities. bot.entity(MessageEntityType.mention, (ctx) async { // And use the `Message.geteEntityText` method to extract the value. diff --git a/lib/src/televerse/filters/filters.dart b/lib/src/televerse/filters/filters.dart deleted file mode 100644 index a031b23..0000000 --- a/lib/src/televerse/filters/filters.dart +++ /dev/null @@ -1,72 +0,0 @@ -part of '../../../televerse.dart'; - -/// Filter lets you filter messages by their content. This is useful when used along with `Televerse.on` method to listen to only specific messages. -/// -/// For example, if you want to listen to only messages which have text, you can use -/// [TeleverseEvent.text] filter. -/// -/// ```dart -/// // This will only listen to messages which have text. -/// bot.on(TeleverseEvent.text, (ctx) { -/// // Do something with the message. -/// ctx.reply('Hello!'); -/// }); -/// ``` -/// -enum TeleverseEvent { - /// Filter for all messages - includes both Update.message and Update.channelPost. - text([UpdateType.message, UpdateType.channelPost]), - - /// Private messages. - /// This filter will only allow private messages. - privateMessage([UpdateType.message]), - - /// Filter for messages or channel posts which have audio. - audio([UpdateType.message, UpdateType.channelPost]), - - /// Filter for messages which have audio. - audioMessage([UpdateType.message]), - - /// Edited messages or channel posts. - edited([UpdateType.editedMessage, UpdateType.editedChannelPost]), - - /// Edited messages. - /// This filter will only allow messages which have been edited. - editedMessage([UpdateType.editedMessage]), - - /// Edited channel posts. - /// This filter will only allow channel posts which have been edited. - editedChannelPost([UpdateType.editedChannelPost]), - - /// Filter for messages or channel posts which have document. - document([UpdateType.message, UpdateType.channelPost]), - - /// Filter for messages which have document. - /// This filter will only allow messages which have document. - documentMessage([UpdateType.message]), - - /// Filter for channel posts which have document. - /// This filter will only allow channel posts which have document. - documentChannelPost([UpdateType.channelPost]), - - /// Filter for messages or channel posts which have photo. - photo([UpdateType.message, UpdateType.channelPost]), - - /// Filter for messages which have photo. - /// This filter will only allow messages which have photo. - photoMessage([UpdateType.message]), - - /// Filter for channel posts which have photo. - /// This filter will only allow channel posts which have photo. - photoChannelPost([UpdateType.channelPost]), - - /// Filters all messages or channel posts which is a command. - command([UpdateType.message, UpdateType.channelPost]), - ; - - /// List of update types which this filter allows. - final List types; - - /// Creates a new filter. - const TeleverseEvent(this.types); -} diff --git a/lib/televerse.dart b/lib/televerse.dart index 8b35249..154e9a1 100644 --- a/lib/televerse.dart +++ b/lib/televerse.dart @@ -45,9 +45,6 @@ part 'src/televerse/context/context.dart'; part 'src/televerse/context/methods.dart'; part 'src/televerse/context/properties.dart'; -// The On Method -part 'src/televerse/filters/filters.dart'; - // Keyboards & Menus part 'src/televerse/markups/inline_keyboard.dart'; part 'src/televerse/markups/inline_menu.dart';