You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π¦ v1.0.0 via ξ v20.12.0
β― npm i input
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
added 32 packages, and audited 134 packages in 8s
13 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Use alternative package of input or in-build readline input library
Input package is instructed to install in README.md
Edit: Neither importing this library works
src/main.ts:3:19 - error TS7016: Could not find a declaration file for module 'input'. '/home/cxinu/dev/bot-dev/tg-premium/node_modules/input/dist/lib/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/input` if it exists or add a new declaration (.d.ts) file containing `declare module 'input';`
3 import input from "input";
~~~~~~~
Found 1 error in src/main.ts:3
Here's an implementation using inbuild readline
import{TelegramClient}from"telegram";import{StringSession}from"telegram/sessions";importreadlinefrom"readline";constapiId=123456;constapiHash="123456abcdfg";conststringSession=newStringSession("");// fill this later with the value from session.save()constrl=readline.createInterface({input: process.stdin,output: process.stdout,});(async()=>{console.log("Loading interactive example...");constclient=newTelegramClient(stringSession,apiId,apiHash,{connectionRetries: 5,});awaitclient.start({phoneNumber: async()=>awaitnewPromise<string>((resolve)=>rl.question("Please enter your number: ",resolve)),password: async()=>awaitnewPromise<string>((resolve)=>rl.question("Please enter your password: ",resolve)),phoneCode: async()=>awaitnewPromise<string>((resolve)=>rl.question("Please enter the code you received: ",resolve)),onError: (err)=>console.log(err),});console.log("You should now be connected.");console.log(client.session.save());// Save this string to avoid logging in againawaitclient.sendMessage("me",{message: "Hello!"});})();
The text was updated successfully, but these errors were encountered:
Use alternative package of input or in-build readline input library
Input package is instructed to install in README.md
Edit: Neither importing this library works
Here's an implementation using inbuild readline
The text was updated successfully, but these errors were encountered: