-
Hello!
$updates = $this->madeline->messages->createChat(
users: $usersInGroup,
title: $title,
);
//var.1 - fails with Could not convert object of type InputChannel:
$chatId = intval('-'.$updates['chats'][0]['id']);
$this->madeline->channels->togglePreHistoryHidden(enabled: false, channel: $chatId);
//var.2 - put in channel update, fails with same exception
$this->madeline->channels->togglePreHistoryHidden(enabled: false, channel: $updates['chat'][0]); Update that i am receiving after createChat: {
"_": "updates",
"updates": [
{
"_": "updateMessageID",
"id": 253340,
"random_id": 1475952799842136664
},
{
"_": "updateChatParticipants",
"participants": {
"_": "chatParticipants",
"chat_id": 4111293142,
"participants": [
{
"_": "chatParticipant",
"user_id": 6735966679,
"inviter_id": 529413773,
"date": 1706001020
},
{
"_": "chatParticipantCreator",
"user_id": 529413773
}
],
"version": 1
}
},
{
"_": "updateNewMessage",
"message": {
"_": "messageService",
"out": true,
"mentioned": false,
"media_unread": false,
"silent": false,
"post": false,
"legacy": false,
"id": 253340,
"from_id": {
"_": "peerUser",
"user_id": ...
},
"peer_id": {
"_": "peerChat",
"chat_id": 4111293142
},
"date": 1706001020,
"action": {
"_": "messageActionChatCreate",
"title": "Some Title",
"users": [
...
]
}
},
"pts": 461207,
"pts_count": 1
},
{
"_": "updateReadHistoryOutbox",
"peer": {
"_": "peerChat",
"chat_id": 4111293142
},
"max_id": 253340,
"pts": 461208,
"pts_count": 1
}
],
"users": [
...
],
"chats": [
{
"_": "chat",
"creator": true,
"left": false,
"deactivated": false,
"call_active": false,
"call_not_empty": false,
"noforwards": false,
"id": 4111293142,
"title": "Some Title",
"photo": {
"_": "chatPhotoEmpty"
},
"participants_count": 2,
"date": 1706001020,
"version": 1,
"default_banned_rights": {
"_": "chatBannedRights",
"view_messages": false,
"send_messages": false,
"send_media": false,
"send_stickers": false,
"send_gifs": false,
"send_games": false,
"send_inline": false,
"embed_links": false,
"send_polls": false,
"change_info": false,
"invite_users": false,
"pin_messages": false,
"manage_topics": false,
"send_photos": false,
"send_videos": false,
"send_roundvideos": false,
"send_audios": false,
"send_voices": false,
"send_docs": false,
"send_plain": false,
"until_date": 2147483647
}
},
{
"_": "channel",
"creator": false,
"left": true,
"broadcast": true,
"verified": false,
"megagroup": false,
"restricted": false,
"signatures": false,
"min": false,
"scam": false,
"has_link": false,
"has_geo": false,
"slowmode_enabled": false,
"call_active": false,
"call_not_empty": false,
"fake": false,
"gigagroup": false,
"noforwards": false,
"join_to_send": false,
"join_request": false,
"forum": false,
"stories_hidden": false,
"stories_hidden_min": true,
"stories_unavailable": true,
"id": 1535424647,
"access_hash": -2726165673161812129,
"title": "Unsupported Chat",
"photo": {
"_": "chatPhotoEmpty"
},
"date": 1627306767
}
],
"date": 1706001019,
"seq": 0,
"request": {
"_": "messages.createChat",
"body": {
"users": [
...
],
"title": "Some Title"
}
}
} What am i doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
danog
Jan 23, 2024
Replies: 1 comment 4 replies
-
The generation method for the ID is wrong, use:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The clients simply autoconvert the chat to a supergroup