1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Classifying per-member menu scope failures (#839).
//!
//! Global `allowed_users` are admins allowed in every group, so their menus
//! must be cleared wherever they are members. But nothing tells us which
//! groups those are: the config records a global grant, not a roster.
//!
//! Telegram answers a `BotCommandScope::ChatMember` call for a user who is not
//! in that chat with an invalid-id error, and that is the only membership
//! signal available here. `getChatMember` fails the same way for a user the bot
//! has never seen in the chat, so probing first costs a round trip per user per
//! group and still errors. The failed call is the membership test.
/// Does this error mean "that user is not in this chat" rather than a fault?
///
/// Matched on the rendered error because teloxide surfaces these as opaque API
/// strings rather than typed variants.
/// The supergroup id a migrated group moved to, if this error reports one.
///
/// A basic group that upgrades to a supergroup gets a new chat id, and every
/// later call against the old one fails. Telegram hands the replacement back in
/// the message itself:
///
/// ```text
/// The group has been migrated to a supergroup with ID #-1004441241066
/// ```
///
/// so recovery needs no extra API call — the failure carries its own fix
/// (#946). Parsed from the rendered string for the same reason
/// `means_not_a_member` is: teloxide surfaces these as opaque API text.