TeleverseEvent enum

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.

// This will only listen to messages which have text.
bot.on(TeleverseEvent.text, (ctx) {
  // Do something with the message.
  ctx.reply('Hello!');
});
Inheritance

Constructors

TeleverseEvent(List<UpdateType> types)
Creates a new filter.
const

Values

text → const TeleverseEvent

Filter for all messages - includes both Update.message and Update.channelPost.

const TeleverseEvent([UpdateType.message, UpdateType.channelPost])
privateMessage → const TeleverseEvent

Private messages. This filter will only allow private messages.

const TeleverseEvent([UpdateType.message])
audio → const TeleverseEvent

Filter for messages or channel posts which have audio.

const TeleverseEvent([UpdateType.message, UpdateType.channelPost])
audioMessage → const TeleverseEvent

Filter for messages which have audio.

const TeleverseEvent([UpdateType.message])
edited → const TeleverseEvent

Edited messages or channel posts.

const TeleverseEvent([UpdateType.editedMessage, UpdateType.editedChannelPost])
editedMessage → const TeleverseEvent

Edited messages. This filter will only allow messages which have been edited.

const TeleverseEvent([UpdateType.editedMessage])
editedChannelPost → const TeleverseEvent

Edited channel posts. This filter will only allow channel posts which have been edited.

const TeleverseEvent([UpdateType.editedChannelPost])
document → const TeleverseEvent

Filter for messages or channel posts which have document.

const TeleverseEvent([UpdateType.message, UpdateType.channelPost])
documentMessage → const TeleverseEvent

Filter for messages which have document. This filter will only allow messages which have document.

const TeleverseEvent([UpdateType.message])
documentChannelPost → const TeleverseEvent

Filter for channel posts which have document. This filter will only allow channel posts which have document.

const TeleverseEvent([UpdateType.channelPost])
photo → const TeleverseEvent

Filter for messages or channel posts which have photo.

const TeleverseEvent([UpdateType.message, UpdateType.channelPost])
photoMessage → const TeleverseEvent

Filter for messages which have photo. This filter will only allow messages which have photo.

const TeleverseEvent([UpdateType.message])
photoChannelPost → const TeleverseEvent

Filter for channel posts which have photo. This filter will only allow channel posts which have photo.

const TeleverseEvent([UpdateType.channelPost])
command → const TeleverseEvent

Filters all messages or channel posts which is a command.

const TeleverseEvent([UpdateType.message, UpdateType.channelPost])

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
types List<UpdateType>
List of update types which this filter allows.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<TeleverseEvent>
A constant List of the values in this enum, in order of their declaration.