@2bad/walt 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/login.js +4 -0
- package/package.json +1 -1
package/build/bin/login.js
CHANGED
|
@@ -10,6 +10,10 @@ const rl = createInterface({
|
|
|
10
10
|
});
|
|
11
11
|
const ask = (question) => rl.question(question);
|
|
12
12
|
const apiId = Number(process.env["TG_API_ID"] || await ask("API id (from https://my.telegram.org): "));
|
|
13
|
+
if (!Number.isSafeInteger(apiId) || apiId <= 0) {
|
|
14
|
+
console.error("The API id must be the number shown at https://my.telegram.org");
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
13
17
|
const apiHash = process.env["TG_API_HASH"] || await ask("API hash: ");
|
|
14
18
|
const client = new TelegramClient(new StringSession(""), apiId, apiHash, { connectionRetries: 3 });
|
|
15
19
|
await client.start({
|