diff --git a/CHANGELOG.md b/CHANGELOG.md index 38caaa5..e8d6564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.2.2 +* Fixed bug with cyrillic text encoding +* Fixed bug with several broken methods invocations +* Optimized authorization performance +* Added fix for automatic base data center selection by [@goodmind][] + # 2.2.1 * Flag (optional type) fields now acts like common fields. * Zeroes, empty strings and empty types now can be omited. write only useful fields. @@ -35,4 +41,6 @@ const connection = network.http({ host: 'ip', port: '80', protocol: 'https' }) const connection = network.wc({ host: 'ip', port: '80' }) ``` * Precision timing -* Major performance boost \ No newline at end of file +* Major performance boost + +[@goodmind]: https://github.com/goodmind/ \ No newline at end of file diff --git a/examples/chat-history.js b/examples/chat-history.js index 50b71f0..9e6da64 100644 --- a/examples/chat-history.js +++ b/examples/chat-history.js @@ -69,19 +69,12 @@ const printMessages = messages => { } -const searchUsers = async () => { +const searchUsers = async (username) => { const results = await telegram('contacts.search', { - q : '@goodmind', + q : username, limit: 100, }) - const results2 = await telegram('contacts.search', { - q : 'goodmind', - limit: 100, - }) - return { - results, - results2 - } + return results } module.exports = { diff --git a/examples/from-readme.js b/examples/from-readme.js index 27139b4..3f1fa85 100644 --- a/examples/from-readme.js +++ b/examples/from-readme.js @@ -6,9 +6,9 @@ const phone = { } const api = { - layer : 57, - initConnection : 0x69796de9, - api_id : 49631 + layer : 57, + initConnection: 0x69796de9, + api_id : 49631 } const server = { @@ -25,9 +25,9 @@ async function connect(){ api_hash : 'fb050b8f6771e15bfda5df2409931569' }) const { user } = await client('auth.signIn', { - phone_number : phone.num, - phone_code_hash: phone_code_hash, - phone_code : phone.code + phone_number: phone.num, + phone_code_hash, + phone_code : phone.code }) console.log('signed as ', user) diff --git a/package.json b/package.json index 55062a3..ec6a902 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "babel-loader": "^6.4.1", "babel-plugin-closure-elimination": "^1.1.14", "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-async-to-module-method": "^6.22.0", "babel-plugin-transform-class-properties": "^6.23.0", "babel-plugin-transform-es2015-block-scoping": "^6.23.0", "babel-plugin-transform-es2015-for-of": "^6.23.0", @@ -104,5 +103,5 @@ "type": "git", "url": "git+https://github.com/zerobias/telegram-mtproto.git" }, - "version": "2.2.1" + "version": "2.2.2" } diff --git a/src/tl/index.js b/src/tl/index.js index 488c885..bfdbdbb 100644 --- a/src/tl/index.js +++ b/src/tl/index.js @@ -83,7 +83,7 @@ export class Serialization { // case 'bytes': fieldObj = [0]; break } } - else throw new Error(`Method ${methodName} doesnt recieve required argument ${paramName}`) + else throw new Error(`Method ${methodName} did not receive required argument ${paramName}`) } else { fieldObj = params[paramName] }