Conversation class

Televerse Conversation

Televerse Conversation is a library that provides a simple way to create a conversation between the user and the bot.

As a Telegram bot developer, there are times when you need to create a conversation between the user and the bot. For example, when you need to ask the user for some information, or when you need to ask the user to choose one of the options. And this can be quite complicated. You need to create a state machine, and you need to store the state of the conversation somewhere. And this is where Televerse Conversation comes in.

Televerse Conversation provides a simple way to create a conversation between the user and the bot. You can create a conversation with just a few lines of code. And you don't need to worry about storing the state of the conversation. Televerse Conversation will take care of that for you.

Televerse Conversation is built on top of the Televerse library. So you can use all the features of the Televerse library in your conversation.

Constructors

Conversation(Bot _bot, {String? name})
Creates a new conversation.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Name of the conversation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear(ID id) Future<void>
Removes all the conversation listeners for the given chat.
clearAll() Future<void>
Clear all the conversation listeners.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
waitFor({required ID chatId, Duration? timeout, bool clearUnfulfilled = true, required bool filter(Update update), String? handlerName}) Future<Context?>
Wait for any message from the user.
waitForCallbackQuery({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a callback query from the user.
waitForContactMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a contact message from the user.
waitForDiceMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a dice message from the user.
waitForDocumentMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a document message from the user.
waitForGameMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a game message from the user.
waitForLocationMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a location message from the user.
waitForPattern({required ID chatId, required Pattern pattern, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for pattern from the user.
waitForPhotoMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a photo message from the user.
waitForPollMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a poll message from the user.
waitForStickerMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a sticker message from the user.
waitForTextMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a text message from the user.
waitForVenueMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a venue message from the user.
waitForVideoMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a video message from the user.
waitForVideoNoteMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a video note message from the user.
waitForVoiceMessage({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a voice message from the user.
waitToEndVideoChat({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a video chat to end.
waitToStartVideoChat({required ID chatId, Duration? timeout, bool clearUnfulfilled = true}) Future<Context?>
Wait for a video chat to start.

Operators

operator ==(Object other) bool
The equality operator.
inherited