Nocturnal Practitioners of Magic

    discord-remote-auth

    1.1.0 • Public • Published

    Discord Remote Auth

    Install

    npm install discord-remote-auth
    

    Usage

    const { RemoteAuthClient } = require('discord-remote-auth')
    const https = require('https')
    const fs = require('fs')
    
    const client = new RemoteAuthClient()
    
    client.on('pendingRemoteInit', fingerprint => {
      const qrCodeStream = fs.createWriteStream('code.png')
      const data = `https://discordapp.com/ra/${fingerprint}`
      https.get(`https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${data}`, res => {
        res.pipe(qrCodeStream)
      })
      qrCodeStream.once('close', () => {
        console.log('Scan ./code.png')
      })
    })
    client.on('pendingFinish', user => {
      fs.unlinkSync('code.png')
      console.log('Incoming User:', user)
    })
    client.on('finish', token => {
      console.log('Token:', token)
    })
    client.on('close', () => {
      if (fs.existsSync('code.png')) fs.unlinkSync('code.png')
    })
    
    client.connect()

    Install

    npm i discord-remote-auth

    DownloadsWeekly Downloads

    40

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    5.98 kB

    Total Files

    5

    Last publish

    Collaborators

    • vap0r1ze