CreateBot class final

Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the user already owns the maximum allowed number of bots as per getOption("owned_bot_count_max"). An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error

Returns User.

Inheritance

Constructors

CreateBot({required int managerBotUserId, required String name, required String username, required bool viaLink})
Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the user already owns the maximum allowed number of bots as per getOption("owned_bot_count_max"). An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error
const

Properties

canBeCalledSynchronously → bool
Whether TDLib documents this request as callable through td_execute.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
managerBotUserId → int
Identifier of the bot that will manage the created bot
final
name → String
Name of the bot; 1-64 characters
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
username → String
Username of the bot. The username must end with "bot" or a string from updateAllowedBotUsernamePremiumSuffixes case-insensitive. Use checkBotUsername to find whether the name is suitable. If the username doesn't end with "bot", then the current user must have Telegram Premium subscription, the chosen username will be assigned as secondary and an additional regular username ending with "bot" will be automatically assigned to the created bot
final
Pass true if the bot is created from an internalLinkTypeRequestManagedBot link
final

Methods

copyWith({int? managerBotUserId, String? name, String? username, bool? viaLink}) → CreateBot
Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.
getConstructor() → String
TDLib function name, e.g. getMe.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson([dynamic extra]) → Map<String, dynamic>
Converts this request to TDLib JSON, tagged with extra if given.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

CONSTRUCTOR → const String
TDLib type name.