vysheng / tg

telegram-cli
GNU General Public License v2.0
6.48k stars 1.53k forks source link

contact_search Method error passing [limit] #1191

Open akosyrev opened 8 years ago

akosyrev commented 8 years ago

Hi I tried to use 'contact_search' method and it works well with one argument:

contact_search yandex Яндекс

I found there is second optional parameter - limit, which defines max users in output. And method fails, when i try to use 2nd arg:

contact_search yandex 5 FAIL: 38: too many args #1

tgchans commented 8 years ago

contact_search doesn't search in your contact list, it search telegram user (or channel/group/bot) with username you set in option. And you can get only one result: info about user with this username, or error like "USERNAME NOT OCCUPIED".

So, there is no limit argument on 'contact_search' - because result can be only one.

По-русски: contact_search ищет не в твоих контактах, а в целом в Telegram, причем результат может быть только один - либо юзернейм занят и ты получаешь инфо о нем, либо не занят о чем тебе непременно сообщат. Поиска в контакт листе насколько я понимаю в cli нет.

akosyrev commented 8 years ago

Ok, I got it - it does exactly search. can you tell me how to call this method https://core.telegram.org/method/contacts.search via tg-cli?