Open aziziphp opened 8 years ago
Did you add --json
?
yes
You can use resolve_username
command, and then use channel_info
with channelId as argument.
resolve_username
does not work for channel name.
It does work for public channels (the ones with usernames). Are you sure you're using the test branch?
Yes I am using test branch. when I try resolve_username channelname
. It retruns FAIL:71: RPC_CALL_FAIL 400: USERNAME_INVALID
. It's a public channel.
It must be used without @
:
> resolve_username telegram
{
"admins_count": 0,
"peer_id": 1005640892,
...
"title": "Telegram News",
"kicked_count": 0
}
> resolve_username @telegram
{"error": "RPC_CALL_FAIL 400: USERNAME_INVALID", "result": "FAIL", "error_code": 71}
Now I understand what you mean. We should provide channel link and get channel name. I wanted the opposite. But I think I can change my code to adapt limitations. thank you anyway.
@codefuhrer I don't think the original question was answered. The problem is that it seems that the channel_info
command has a different output if you are running in --json
mode vs. without it.
For example, just running telegram-cli
:
> channel_info Telegram_News
Channel [verified] [broadcast] Telegram News @telegram (#1005640892):
about: The official Telegram on Telegram. Much recursion. Very Telegram. Wow.
69384 participants, 0 admins, 0 kicked
If I run with telegram-cli --json
:
> channel_info Telegram_News
{
"id": "$05000000bcdcf03b76355d7faddb6a64",
"peer_type": "channel",
"admins_count": 0,
"flags": 65675,
"peer_id": 1005640892,
"print_name": "Telegram_News",
"title": "Telegram News",
"kicked_count": 0,
"participants_count": 69384
}
The first example has the channel link, @telegram. The second one does not.
Hi channel_info returns channel public link in usual mode but not in json mod. Is there any other trick to get link of a channel in json mode?