Closed nmlorg closed 2 years ago
{'chat_join_request': {'chat': {'all_members_are_administrators': True, 'id': -987654321, 'title': 'invite link test group', 'type': 'group'}, 'date': 1636414880, 'from': {'first_name': 'FiRsT', 'id': 123456789, 'is_bot': False, 'last_name': 'LaSt', 'username': 'UsErNaMe'}, 'invite_link': {'creates_join_request': True, 'creator': {...
>>> bot.sendmessage(chat_id=123456789, text='test') ntelebot.errors.Forbidden: {'ok': False, 'error_code': 403, 'description': "Forbidden: bot can't initiate conversation with a user"}
Despite the one-character case mismatch, I assume this is coming from td/telegram/MessagesManager.cpp:
void MessagesManager::on_send_message_fail(int64 random_id, Status error) { ⋮ } else if (error.message() == "PEER_ID_INVALID") { error_code = 403; if (td_->auth_manager_->is_bot() && (dialog_id.get_type() == DialogType::User || dialog_id.get_type() == DialogType::SecretChat)) { error_message = "Bot can't initiate conversation with a user"; }
and I don't see PEER_ID_INVALID anywhere else, so I assume this is a server restriction.
PEER_ID_INVALID
I'm working on a bot to replace the "lobby/foyer" pattern, where:
My original idea was:
/start
I would like to switch to:
chat_join_request
This was planned as a part of Bot API 5.5 update and the feature is live now.
# Дубликат #
Despite the one-character case mismatch, I assume this is coming from td/telegram/MessagesManager.cpp:
and I don't see
PEER_ID_INVALID
anywhere else, so I assume this is a server restriction.I'm working on a bot to replace the "lobby/foyer" pattern, where:
My original idea was:
/start
command.I would like to switch to:
chat_join_request
update to be sent to the bot.