importContacts and getFullUser methods
Hi guys and thanks for the great project!
I've added a couple of API methods, review them please. Comments are welcome.
Thanks, Denis.
Coverage increased (+0.05%) to 90.217% when pulling f56704cee3711122e3e0b846effc43440d8a8741 on denis-it:master into 37c4a98f17d2311ee4335fdd42df497ff30a1153 on enricostara:master.
using importContacts with non-latin first or last name causes 404 error :( how can i fix that?
Hi @FragsterAt,
It looks like request with non-latin characters constructed incorrectly, so the server returns 404. I think good points to start research are following:
- String serialization methods in telegram-tl-node:
writeString,_writeBytes. - Encryption methods in telegram-mt-node:
serialize.
Hope this helps.
@denis-it At first glance, this solves the problem:
// Write the `string` value given as argument
TypeObject.prototype.writeString = function (str) {
//return this.writeBytes(str);
return this.writeBytes(Buffer.from(str));
};
you can use it same way in https://github.com/goodmind/telegram-mtproto and https://github.com/zerobias/telegram-mtproto if they're buggy. I can not check, because I can't call importContacts with any arguments: https://github.com/zerobias/telegram-mtproto/issues/6
cc @zerobias
I've checked it, working fine with Buffer.from(str). Good work, @FragsterAt! :+1: