事实核查
Telegram客户端支持显示由独立事实核查员添加到消息中的事实核查信息。
显示事实核查
factCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck;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;---functions---messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;
事实核查由factCheck构造函数表示,该构造函数包含在消息factcheck构造函数的字段中。
有时(例如出于性能原因),即使消息确实有事实核查,它也可能不会在与消息关联的factChecktext字段中返回:在这种情况下,将设置factCheck.标志,但不会设置/标志,客户端应在消息滚动到视图时 使用messages.getFactCheck手动请求事实核查的全文。need_checkcountrytext
这些手动请求应该打包:每次向要手动获取的事实核查队列中添加新 ID 时,将获取延迟 80 毫秒。
将所有完整的(即带有斜杠country的text)事实核查信息存储在本地数据库中,并使用hash作为键。如果本地数据库中已缓存了具有相同键值的事实核查信息,
则避免获取最小值(即已设置键值)的事实核查信息。need_checkhash
示例实现:android。
编辑事实核查
factCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck;---functions---messages.editFactCheck#0589ee75 peer:InputPeer msg_id:int text:TextWithEntities = Updates; messages.deleteFactCheck#d1da940c peer:InputPeer msg_id:int = Updates;
独立事实核查员可以使用messages.editFactCheck和messages.deleteFactCheck创建、删除和编辑事实核查。
独立事实核查员可以使用这些方法,他们的appConfig.can_edit_factcheck配置标志会设置为true。
如果将上述标志设置为 truetrue,则事实检查的最大 UTF-8 长度将在appConfig.factcheck_length_limit字段中指定。