Layer 227
method Users
bots.createBot#e5b17f2b flags:# via_deeplink:flags.0?true name:string username:string manager_id:InputUser = User;

Parameters

Name Type Description
ViaDeeplink flags .0? true Set only if the creation prompt was opened from a managed bot creation request deep link
Name string Display name of the bot, 1–64 characters
Username string Username for the bot, as validated by bots. check Username
ManagerId InputUser The manager bot that will control the created bot; must have the user. bot_can_manage_bots flag set

Returns

User

Gogram Example

// BotsCreateBot - positional arguments
result, err := client.BotsCreateBot(nil, "Hello, World!", "Hello, World!", &tg.InputUserSelf{})
if err != nil {
    // handle error
}
// result is *tg.User

Possible Errors

Code Type Description
400 BOT_CREATE_LIMIT_EXCEEDED The current user already owns the maximum allowed number of owned bots, as specified by bots_create_limit_default and bots_create_limit_premium; if the current user doesn't have Telegram Premium, upgrading to Premium will allow them to create more bots..
400 MANAGER_INVALID The specified manager bot is invalid.
400 MANAGER_PERMISSION_MISSING The specified manager bot does not have the user. bot_can_manage_bots flag set.
400 NAME_INVALID The specified bot name is invalid.
400 USERNAME_INVALID The provided username is not valid.
400 USERNAME_OCCUPIED The provided username is already occupied.
400 USERNAME_SUFFIX_MISSING The required bot suffix is missing from the passed username.