mirror of
https://git.stupid.fish/teidesu/scripts.git
synced 2025-07-28 02:32:11 +10:00
chore: update public repo
This commit is contained in:
parent
e0109980c0
commit
e7c9507247
25 changed files with 5364 additions and 0 deletions
20
scripts/auth/mtcute-login.ts
Normal file
20
scripts/auth/mtcute-login.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import qrTerminal from 'qrcode-terminal'
|
||||
import { createTg } from '../../utils/telegram.ts'
|
||||
|
||||
const sessionName = process.argv[2]
|
||||
if (!sessionName) {
|
||||
console.error('Usage: mtcute-login.ts <session name>')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const tg = createTg(sessionName)
|
||||
|
||||
const self = await tg.start({
|
||||
qrCodeHandler(url, expires) {
|
||||
console.log(qrTerminal.generate(url, { small: true }))
|
||||
},
|
||||
})
|
||||
|
||||
console.log(`Logged in as ${self.displayName} (${self.id})`)
|
||||
|
||||
await tg.close()
|
Loading…
Add table
Add a link
Reference in a new issue