televerse library

Televerse provides a simple and easy way to create Telegram bots. This library exports all the Televerse related classes and methods.

Usage

The Televerse class let's you create a new bot instance. Or you can simply call it Bot.

import 'package:televerse/televerse.dart';

void main() {
   Bot bot = Bot("<YOUR BOT TOKEN>");
}

To import all the Telegram models, you can use the telegram.dart file.

import 'package:televerse/telegram.dart';

Happy coding!

Classes

Bot
Televerse This class is used to create a new bot instance. The bot instance is used to send and receive messages.
BotAdminRights
Represents a bot admin rights.
This class represents a Telegram bot deeplink.
This class represents a Telegram channel deeplink.
ChannelID
This class is used to represent a channel id. It is a subclass of ID.
ChatID
This class is used to represent a chat id. It is a subclass of ID.
Context
This class is used to represent the context of an update. It contains the update and the RawAPI instance.
Conversation
Televerse Conversation
CustomEmoji
This object represents a custom emoji entity.
This class represents a Telegram deeplink.
Fetcher
Fetcher - This is the base class for all fetchers. It is used to fetch updates from the Telegram API. You can use this class to create your own fetcher. Currently, there are two fetchers: LongPolling and Webhook.
Game Links
This class represents a Telegram group deeplink.
HandlerScope
A Handler Scope is used to define the scope and related information of a handler method.
ID
This class is used to represent a chat id. It is a superclass of ChatID, ChannelID and SupergroupID.
InlineKeyboard
Represents an inline keyboard that appears right next to the message it belongs to. This is a shortcut for InlineKeyboardMarkup.
InlineMenu
This object represents a Inline Keyboard with the action to be done.
InlineMenuData
Class for handling inline menu displayed text and callback data used in InlineMenu
InlineQueryResultBuilder
A utility class to build Inline Query Results quickly and easily.
InputFile
This class is used to represent a file to be sent.
Keyboard
The Keyboard class can be used to represent a ReplyKeyboardMarkup. This is an easy method to show a keyboard to the user.
KeyboardMenu
This object represents a Keyboard menu with the actions to be done.
LinkText
This class represents a Telegram deeplink text.
LoggerOptions
This class represents the logger options.
LongPolling
A class that handles long polling. This class is used to fetch updates from the Telegram API. It uses the long polling method.
MessageContentGenerator
Basically stuffs the input message content to the Inline Query Result
Used to share a proxy server that can be used to connect to Telegram.
Used to link to public and private users by their phone number.
RawAPI
Raw API for the Telegram Bot API.
ScopeOptions
Represents additional options that can be passed to create Handler Scope
Represents Telegram settings deeplinks.
Used to share a prepared message and URL into a chosen chat's text field. These links should be handled as follows: Open a dialog selection prompt After selection: validate, trim and enter the URL at the beginning of the text field Append a newline to the text field Append and select the text, if present
Used to share a proxy server that can be used to connect to Telegram.
SupergroupID
This class is used to represent a supergroup id. It is a subclass of ID.
TeleverseMenu
Abstract class to represent a menu
ID links are merely an abstraction offered by the bot API to simplify construction of inputMessageEntityMentionName and inputKeyboardButtonUserProfile constructors, and should be ignored by normal clients.
UserMention
A class representing a mention.
Used to link to public users, groups and channels, see here for more info on how to handle them ยป.
Webhook
This class is used to create a webhook fetcher. It is a subclass of Fetcher.

Enums

APIMethod
Method - these are the available methods in the Telegram Bot API.
APIScheme
API Scheme - HTTP or HTTPS.
BackgroundFillType
This object represents the type of a BackgroundFill
BackgroundTypeType
This object represents the type of a background.
BotCommandScopeType
This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
ChatAction
This object represents a chat action.
ChatBoostSourceType
Type of the chat boost source.
ChatMemberStatus
This object represents the status of a member in a chat.
ChatType
This object represents type of a chat. Currently, the following 5 types are supported:
ConversationExceptionType
Type of the Conversation exception.
DiceEmoji
This object represents dice emoji.
InlineQueryResultType
This object represents the type of a result of an inline query.
InputFileType
This object represents the type of a file to send. Currently, the following 3 types are supported:
InputMediaType
This object represents the type of a media to send. Currently, the following 5 types are supported:
InputStickerFormat
This object describes a sticker to be added to a sticker set.
MaskPositionPoint
This object represents the position on faces where a mask should be placed by default.
This object represents the Menu Button Type. Read about the Menu Button here.
MessageEntityType
Type of the entity. Currently, can be: one of
MessageOriginType
The type of a `MessageOrigin
ParseMode
This object represents the ParseMode of a message. See the Telegram API docs for more information.
PassportType
This object represents a Telegram Passport element containing the user's personal details.
PollType
This object contains information about a poll. Currently supported poll types are regular and quiz.
ReactionTypeType
Represents the type of emoji used in a reaction.
StickerFormat
StickerFormat to specify the type of sticker used with RawAPI.createNewStickerSet
StickerType
A class that represents the type of a sticker.
TeleverseEvent
Filter lets you filter messages by their content. This is useful when used along with Televerse.on method to listen to only specific messages.
TeleverseExceptionType
Enum to classify different types of Televerse exceptions.
TGException
Telegram Exceptions Database
UpdateType
This object represents type of an incoming update.

Extensions

CleanString on String
String extension, to clean the String
Filename on File
Filename extension for io.File is used to get the filename of a file.
FromAndChatExt on Update
Update extension to get the Chat and User from the update.
GetChatID on Chat
Extension on Chat to create ID of the chat
GetUserChatID on User
Extension on User to create ID of the chat
IntDate on int
IntDate extension is used to convert an integer to a DateTime object. The integer is assumed to be unix time.
Mention on User
Extensions for the User class.
On on Bot
The On event. Attaches handlers for specific events.
UnixTime on DateTime
UnixTime extension is used to convert a DateTime object to unix time.

Typedefs

Handler = FutureOr<void> Function(Context ctx)
Base handler
Televerse = Bot
The main class of the library.

Exceptions / Errors

BotError
This object will be passed to the error handler. It contains the error and the stack trace.
ConversationException
An exception thrown when a conversation times out or the listener has been cancelled before it was fulfilled.
LongPollingException
HttpException is thrown when the long polling fails. This exception is thrown when the limit is invalid or the timeout is invalid.
TelegramException
HttpException is thrown when the HTTP request fails.
TeleverseException
TeleverseException is thrown when an error occurs in the library.
WebhookException
WebhookException is thrown when an error occurs while setting up a webhook.