Can't understand the meaning of returned exception USER_BANNED_IN_CHANNEL
on sending chatAction
to the supergroup
while @TrueMafiaBot
(id: 468253535
) is a member
of that supergroup (e.g. -1001639443192
) and has all required permissions.
Looks like a #bug. I know about 3000 groups with similar bot behaviour.
I tell my users to give admin permissions to the bot - it helps to avoid described behaviour.
All described below JSONs are not modified, just masked token in URLs and chat join link.
Let's try to send chat action...
https://api.telegram.org/bot{{token}}/sendChatAction
{
"action": "typing",
"chat_id": -1001639443192
}
{
"ok": false,
"error_code": 400,
"description": "Bad Request: USER_BANNED_IN_CHANNEL"
}
May be bot is really banned? Let's look...
https://api.telegram.org/bot{{token}}/getChatMember
{
"chat_id": -1001639443192,
"user_id": 468253535
}
{
"ok": true,
"result": {
"user": {
"id": 468253535,
"is_bot": true,
"first_name": "True Mafia",
"username": "TrueMafiaBot"
},
"status": "member"
}
}
May be Chat
has restricted permissions by default?
May be Chat
has a wrong type
(e.g. channel
)?
Let's check...
https://api.telegram.org/bot{{token}}/getChat
{
"chat_id": -1001422827258
}
{
"ok": true,
"result": {
"id": -1001422827258,
"title": "fams lia💘",
"username": "famsslia",
"type": "supergroup",
"invite_link": "https://t.me/...",
"permissions": {
"can_send_messages": true,
"can_send_media_messages": true,
"can_send_polls": true,
"can_send_other_messages": true,
"can_add_web_page_previews": true,
"can_change_info": false,
"can_invite_users": true,
"can_pin_messages": false
},
"photo": {
"small_file_id": "AQADBQAD264xG8FbCVcACAIAAwZRjNYW____fLGIVCxHb2MjBA",
"small_file_unique_id": "AQAD264xG8FbCVcAAQ",
"big_file_id": "AQADBQAD264xG8FbCVcACAMAAwZRjNYW____fLGIVCxHb2MjBA",
"big_file_unique_id": "AQAD264xG8FbCVcB"
},
"pinned_message": {
"message_id": 244,
"from": {
"id": 2110231490,
"is_bot": false,
"first_name": "lia🎸",
"username": "grblia",
"language_code": "id"
},
"chat": {
"id": -1001422827258,
"title": "fams lia💘",
"username": "famsslia",
"type": "supergroup"
},
"date": 1642136416,
"edit_date": 1642138077,
"text": "Bkin fams yk \n\nDdy : \nBuna : sy (Lia)\n\nAbng 1 : Alvino ( not id )\nAbng 2 : Ardory\nAbng 3 :\nAbng 4 : jidan\n\nTth 1 :\nTth 2 : \nTth 3 : Yoonsa Alexander\nTth 4 : vya\n\nBontot 1: Lyara \nBontot 2: alexxa aldebagong\nBontot 3: ellena\nBontot 4:\n\nAunty 1 : KEY!\nAunty 2 : \nAunty 3 : zeiy\nAunty 4 :\n\nUncle 1 : Jacky\nuncle 2 :\nUncle 3 :\nuncle 4 :\n\nYng Minat bae\nhttps://t.me/famsslia",
"entities": [
{
"offset": 352,
"length": 21,
"type": "url"
}
]
}
}
}