电报商业

用户可以将他们的 Telegram 帐户转换为企业帐户,从而获得营业时间、位置、快速回复、自动消息、自定义起始页、聊天机器人支持等企业功能。

目前,所有 Telegram Business 功能都对高级订阅用户免费开放。

营业时间

timezone#ff9289f5 id:string name:string utc_offset:int = Timezone;help.timezonesListNotModified#970708cc = help.TimezonesList; help.timezonesList#7b74ed71 timezones:Vector<Timezone> hash:int = help.TimezonesList;businessWeeklyOpen#120b1ab9 start_minute:int end_minute:int = BusinessWeeklyOpen;businessWorkHours#8c92b098 flags:# open_now:flags.0?true timezone_id:string weekly_open:Vector<BusinessWeeklyOpen> = BusinessWorkHours;userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.updateBusinessWorkHours#4b00e066 flags:# business_work_hours:flags.0?BusinessWorkHours = Bool;help.getTimezonesList#49b30240 hash:int = help.TimezonesList;

商家可以显示营业时间;此信息将包含在userFull中。要设置此信息,请使用business_work_hoursaccount.updateBusinessWorkHours,并传入一个businessWorkHours构造函数:

更改营业时间将发出updateUser请求。

要删除所有营业时间信息,请调用account.updateBusinessWorkHours而不填充business_work_hours标志。

地点

businessLocation#ac5c1af7 flags:# geo_point:flags.0?GeoPoint address:string = BusinessLocation;userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.updateBusinessLocation#9e6b131a flags:# geo_point:flags.1?InputGeoPoint address:flags.0?string = Bool;

商家可以使用account.updateBusinessLocation来宣传其位置;然后, 该信息将通过userFull返回给用户。business_location

该方法接受两个参数:

要删除商家位置信息,请调用该方法而不设置任何参数。

如果设置了 ageo_point,则还会使用附近的用户功能向地理位置相近的用户宣传该商家的位置,如这里所述 »。

请注意,即使只address设置了(无论是否带有geo_point),也不能使用contacts.getLocated方法更改用户的当前地理位置(例如,对于附近的用户功能):它将返回一个BUSINESS_ADDRESS_ACTIVE错误,表明只能使用account.updateBusinessLocation »更改(或删除)位置。

更改位置将发出updateUser请求。

快速回复快捷方式

Telegram Business 允许您创建快速回复。
快速回复是发送预设消息的快捷方式,这些消息可以包含多条消息,并支持文本格式、链接、贴纸、媒体和文件。

快速回复快捷方式具有名称(显示给用户)、数字 ID 和一组关联的消息。

获取现有的快速回复快捷方式

message#9815cec8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message;quickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply;messages.quickReplies#c68d6695 quick_replies:Vector<QuickReply> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.QuickReplies; messages.quickRepliesNotModified#5f91eb5b = messages.QuickReplies;---functions---messages.getQuickReplies#d483f2a8 hash:long = messages.QuickReplies; messages.getQuickReplyMessages#94a495c3 flags:# shortcut_id:int id:flags.0?Vector<int> hash:long = messages.Messages;

要获取有关所有现有快速回复快捷方式的基本信息,请使用messages.getQuickReplies。

该方法将返回每个快捷方式的 ID 和名称,以及快捷方式中的消息数量和每个快捷方式的最后一条消息的 ID(以及消息本身messages)。

请注意,这hash是用于缓存的,它不是通过使用消息 ID 生成的,而是通过传递给通常的哈希算法的以下整数集生成的。

vector<uint64> hash_ints = [];foreach (quick_replies as quick_reply) {hash_ints.append((uint64) quick_reply.shortcut_id);hash_ints.append((uint64) hexdec(substr(md5(quick_reply.shortcut), 0, 16)));hash_ints.append((uint64) quick_reply.top_message);hash_ints.append((uint64) (top_message.edit_date || 0));}

如果传递的哈希值与服务器端哈希值相等,则该方法将返回messages.quickRepliesNotModified ,这意味着快速回复的顺序、名称和最后一条消息都没有改变。

编辑快速回复中的中间消息不会改变哈希值,因此应该使用messages.getQuickReplyMessages来获取快速回复快捷方式中的(部分或全部)消息,其哈希值生成方式如下:

vector<uint64> hash_ints = [];foreach (messages as message) {hash_ints.append((uint64) message.id);hash_ints.append((uint64) message.edit_date || 0);}

然后必须将生成的整数列表传递给通常的哈希算法。

向快速回复快捷方式添加消息

inputQuickReplyShortcut#24596d41 shortcut:string = InputQuickReplyShortcut; inputQuickReplyShortcutId#1190cf1 shortcut_id:int = InputQuickReplyShortcut;message#9815cec8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message;quickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply;updateNewQuickReply#f53da717 quick_reply:QuickReply = Update; updateQuickReplyMessage#3e050d0f message:Message = Update;---functions---messages.sendMessage#fe05dc9a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates; messages.sendMedia#ac55d9c1 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates; messages.sendMultiMedia#1bf89d74 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates; messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut allow_paid_stars:flags.21?long = Updates; messages.forwardMessages#978928ca flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;messages.checkQuickReplyShortcut#f1d0fbd3 shortcut:string = Bool;

要向快速回复快捷方式添加消息,请使用messages.sendMessage、messages.sendMedia、messages.sendMultiMedia、messages.sendInlineBotResult或messages.forwardMessages以及peer=inputPeerSelfquick_reply_shortcut,并使用InputQuickReplyShortcut构造函数填充标志。

InputQuickReplyShortcut构造函数可以是以下两种类型之一:

如果指定的快速回复不存在,则会在调用上述方法时创建该快速回复,并向所有已登录会话 发出额外的updateNewQuickReply 。

快捷方式(无论是新建的还是已有的)的数字 ID 将包含在调用上述方法返回的updateQuickReplyMessage更新消息的squick_reply_shortcut_id字段中。返回的消息将使用通用的消息序列,与 API 中使用的任何其他消息 ID 序列无关。
id

appConfig.quick_replies_limit快捷方式最多只能创建 2 个,否则400 QUICK_REPLIES_TOO_MUCH上述方法会报错。

每个快捷方式最多可以包含appConfig.quick_reply_messages_limit消息,否则400 REPLY_MESSAGES_TOO_MUCH上述方法将发出错误。

在向用户提供将消息添加到快速回复快捷方式的选项之前,请务必调用messages.checkQuickReplyShortcut并传递快捷方式名称,以确保未达到上述任何限制。

发送快速回复快捷方式

---functions---messages.sendQuickReplyMessages#6c750de1 peer:InputPeer shortcut_id:int id:Vector<int> random_id:Vector<long> = Updates;

要向用户发送快速回复快捷方式,请使用messages.sendQuickReplyMessages,并传递快捷方式 ID。

快速回复功能只能由用户在与其他用户的私聊中发送。用于选择快速回复的界面应与用于机器人命令的界面类似,但使用快捷方式名称而非机器人命令名称。

您可以在字段中指定消息的子集id,以便仅发送部分快捷消息(如果为空,则默认发送所有消息)。

编辑快速回复快捷消息

updateQuickReplyMessage#3e050d0f message:Message = Update;---functions---messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;

使用messages.editMessage编辑快速回复快捷方式中的消息,传入消息 IDid和快捷方式 IDquick_reply_shortcut_id。

这将发出一个updateQuickReplyMessage更新。

删除快速回复快捷消息

updateDeleteQuickReplyMessages#566fe7cd shortcut_id:int messages:Vector<int> = Update;---functions---messages.deleteQuickReplyMessages#e105e910 shortcut_id:int id:Vector<int> = Updates;要从快速回复快捷方式中删除一条或多条消息,请使用`messages.deleteQuickReplyMessages`方法,并传入快捷方式 ID 和要删除的消息 ID 列表。

此操作还会触发 `updateDeleteQuickReplyMessages`更新。


重命名快速回复快捷方式

updateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update;---functions---messages.editQuickReplyShortcut#5c003cef shortcut_id:int shortcut:string = Bool;

使用messages.editQuickReplyShortcut可以重命名快捷方式。
这将向其他已登录会话 发送updateQuickReplies更新。

重新排列快速回复快捷方式

updateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update;---functions---messages.reorderQuickReplies#60331907 order:Vector<int> = Bool;

使用messages.reorderQuickReplies可以重新排列快速回复快捷方式(而非快捷方式内的消息);传入order所有已创建的快速回复快捷方式的 ID,并按所需顺序排列。
这将向其他已登录会话 发送updateQuickReplies更新。

删除快速回复快捷方式

updateDeleteQuickReply#53e6f1ec shortcut_id:int = Update;---functions---messages.deleteQuickReplyShortcut#3cc04740 shortcut_id:int = Bool;

要彻底删除快速回复快捷方式,请使用messages.deleteQuickReplyShortcut。
这还会向其他已登录的会话发出updateDeleteQuickReply更新(但不会发出updateDeleteQuickReplyMessages更新,即使快捷方式中的所有消息也通过此方法删除)。

问候语

inputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients;inputBusinessGreetingMessage#194cb3b shortcut_id:int recipients:InputBusinessRecipients no_activity_days:int = InputBusinessGreetingMessage;businessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients;businessGreetingMessage#e519abab shortcut_id:int recipients:BusinessRecipients no_activity_days:int = BusinessGreetingMessage;userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.updateBusinessGreetingMessage#66cdafc4 flags:# message:flags.0?InputBusinessGreetingMessage = Bool;

Telegram Business 允许配置一组欢迎消息,这些消息会自动发送给首次私信联系我们的新用户,或者在用户一段时间不活跃后发送给他们。

使用account.updateBusinessGreetingMessage设置(列表)问候语消息message;要禁用问候语,请调用该方法而不填充message字段。

如果填写了该字段,则该message字段必须包含inputBusinessGreetingMessage,请参阅构造函数页面 »以了解其内容说明以及介绍标题和描述的长度限制。

当前用户可以通过userFull获取当前配置的商务问候语,该问候语由businessGreetingMessage 构造函数 »business_greeting_message表示,相当于输入对应项。

离开消息

inputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients;businessAwayMessageScheduleAlways#c9b9e2b9 = BusinessAwayMessageSchedule; businessAwayMessageScheduleOutsideWorkHours#c3f2f501 = BusinessAwayMessageSchedule; businessAwayMessageScheduleCustom#cc4d9ecc start_date:int end_date:int = BusinessAwayMessageSchedule;inputBusinessAwayMessage#832175e0 flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:InputBusinessRecipients = InputBusinessAwayMessage;businessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients;businessAwayMessage#ef156a5c flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:BusinessRecipients = BusinessAwayMessage;userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.updateBusinessAwayMessage#a26a7fa5 flags:# message:flags.0?InputBusinessAwayMessage = Bool;

Telegram Business 允许配置一组“离开”消息,当用户离线、下班、休假或在其他自定义时间段内无法立即回复用户时,这些消息会自动发送给给我们发消息的用户。

使用account.updateBusinessAwayMessage设置离开消息(列表)message;要禁用问候语,请调用该方法而不填充message字段。

如果已填充,则该message字段必须包含inputBusinessAwayMessage,有关其内容的说明 ,请参阅构造函数页面 » 。

当前用户可以通过userFull获取当前配置的商务外出消息,该消息由businessAwayMessage 构造函数 »business_away_message表示,相当于输入对应项。

公司介绍

inputBusinessIntro#09c469cd flags:# title:string description:string sticker:flags.0?InputDocument = InputBusinessIntro;businessIntro#5a0a066d flags:# title:string description:string sticker:flags.0?Document = BusinessIntro;userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.updateBusinessIntro#a614d034 flags:# intro:flags.0?InputBusinessIntro = Bool;

Telegram Business 允许配置个人资料介绍的消息和贴纸 »,这些消息和贴纸会显示给尚未与我们建立私聊的新用户。

使用account.updateBusinessIntro设置自定义企业介绍;调用相同的方法而不设置标志,intro即可移除自定义企业介绍,默认使用随机选择的介绍消息和贴纸(有关默认个人资料介绍的更多信息, 请参阅此处 » )。

更改业务介绍将发出updateUser操作,并且业务介绍将包含在userFull中。intro

请注意,问候贴纸选择界面应提供类别列表,以便按表情符号(列表)或其他条件快速筛选结果,详情 请参见此处» 。

商务聊天链接

inputBusinessChatLink#11679fa7 flags:# message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string = InputBusinessChatLink;businessChatLink#b4ae666f flags:# link:string message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string views:int = BusinessChatLink;account.businessChatLinks#ec43a2d1 links:Vector<BusinessChatLink> chats:Vector<Chat> users:Vector<User> = account.BusinessChatLinks;account.resolvedBusinessChatLinks#9a23af21 flags:# peer:Peer message:string entities:flags.0?Vector<MessageEntity> chats:Vector<Chat> users:Vector<User> = account.ResolvedBusinessChatLinks;---functions---account.createBusinessChatLink#8851e68e link:InputBusinessChatLink = BusinessChatLink; account.getBusinessChatLinks#6f70dde1 = account.BusinessChatLinks; account.editBusinessChatLink#8c3410af slug:string link:InputBusinessChatLink = BusinessChatLink; account.deleteBusinessChatLink#60073674 slug:string = Bool;account.resolveBusinessChatLink#5492e5ee slug:string = account.ResolvedBusinessChatLinks;

企业聊天深度链接允许企业主分享其 Telegram 企业帐户的预制链接,并可选择在消息输入字段中填写预先准备好的消息(支持样式化的文本实体 »)。

除了通常的message_length_max之外,准备的消息长度没有其他限制(因为消息文本不在URL 的查询字符串中,而是使用链接别名从服务器获取);每个创建的商务聊天深度链接都有一个查看计数器。

使用account.createBusinessChatLink创建企业聊天链接,在inputBusinessChatLink中指定用户打开链接时要预填充的消息,并在 中指定链接的易读名称title,以便于管理已创建的链接。
创建的深度链接会返回到该link字段中,可以直接分享,也可以分享为二维码。

使用account.getBusinessChatLinks获取有关所有已创建的企业聊天链接的信息(包括查看计数器,指示用户解析(点击、浏览)企业聊天链接的次数)。

使用account.editBusinessChatLink编辑企业聊天链接的信息。

使用account.deleteBusinessChatLink删除企业聊天链接。

使用account.resolveBusinessChatLink打开企业聊天链接,获取要联系的对等方以及(如果已设置)要预填的消息,同时增加链接的查看计数器。

上面列出的最后三种方法需要一个企业聊天链接别名,该别名应按照此处的规定从企业聊天链接中提取»。

除account.resolveBusinessChatLink外,所有列出的方法都需要 Telegram Business 订阅(目前包含在Telegram Premium订阅中)。

一个帐户最多可以创建business_chat_links_limit个企业聊天链接:尝试超过此限制将发出CHATLINKS_TOO_MUCHRPC 错误,提示用户删除较旧的链接。

联网机器人

企业用户可以连接 Telegram 机器人,由它们代表用户处理和回复消息。这使得企业能够无缝集成任何现有工具和工作流程,或者添加AI 助手来管理聊天。

请参阅此处»以获取有关连接到企业用户帐户的业务机器人的完整文档。

重新启用广告

userFull#c577b5ad flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull;---functions---account.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool;

由于 Telegram Business 目前包含在Telegram Premium订阅中,而 Telegram Premium 订阅用户在频道中看不到赞助消息。

对于希望通过Telegram 广告平台发布和查看自己的 Telegram 广告的企业主来说,这可能会造成问题。

因此,Telegram Business 设置页面应该包含一个开关,用于重新启用当前帐户的 Telegram 广告,这将触发对account.toggleSponsoredMessages 的调用。

切换开关的当前值将存储在userFull中。sponsored_enabled

文件夹标签

Telegram Business 用户可以使用文件夹标签,点击此处 »了解更多信息。

商业功能推广页面

Telegram Business 提供了一系列额外的功能和更高的限制:客户应了解当前的订阅状态,以便相应地调整客户行为。

---functions---help.getAppConfig#61e3f854 hash:int = help.AppConfig;

客户端应在设置中显示 Telegram Business 按钮。
点击此按钮应打开 Telegram Business 弹窗。

help.getAppConfig获取有关如何构建 Telegram Business 模态框的信息,在business_promo_orderappConfig 字段中返回 Business 功能标识符列表:模态框应包含每个返回功能的行,并按返回数组中指定的顺序排列。

可能的特征标识符:

business_location

企业用户可以设置企业位置

business_hours

企业用户可以设置营业时间

quick_replies

企业用户可以创建和使用快速回复快捷方式

greeting_message

企业用户可以设置欢迎消息

away_message

企业用户可以设置自动回复消息

business_links

企业用户可以创建企业聊天链接

business_intro

企业用户可以设置自定义商务聊天介绍

business_bots

企业用户可以将企业机器人连接到他们的帐户

emoji_status

企业用户可以设置自定义表情符号状态。

folder_tags

企业用户可以启用文件夹标签。

stories

企业用户可以使用故事来展示产品(即客户无需实现任何额外功能,这只是使用故事的另一种方式)。