Naozumi520 / Remedy

Unofficial Discord Overlay support for macOS, support both x86 and arm64!
MIT License
33 stars 6 forks source link

[Feature] Login with QR #7

Closed aiko-chan-ai closed 2 years ago

aiko-chan-ai commented 2 years ago

it's easier to use QR code to login (instead of using Token) and my library supports it 🎉

Document: Here

const client = new Discord.Client();

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);
});

/**
 * @type {Discord.DiscordAuthWebsocket}
 * @see {@link https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/DiscordAuthWebsocket}
 */
const RemoteAuth = client.QRLogin();

RemoteAuth.on('ready', (url) => {
    console.log(`Expire: `, RemoteAuth.missQR.toLocaleString());
    // function that generates a QR code image
    const image = genQRCode(url);
    // render image
})
    .on('success', (user, token) => {
        console.log(`${user.tag} `);
    });
Naozumi520 commented 2 years ago

wow! This really makes logging in easier, thanks! I will take a look when I'm free 😁

Naozumi520 commented 2 years ago

Close as ready in next release