This is a project for users that wants to use the Discord API to retrieve and display user information via the Lanyard API. The project is written in Node.js and includes all the necessary code to quickly get started with implementing the Lanyard API into your own site.
To get started with this project, follow these steps:
-
Join
Lanyard Discord
-
Copy you Discord User ID to a
.env
file -
Go to your project and run:
npm install node-discord-presence
-
Use the API like the next example:
import { fetchDiscordStatus } from "node-discord-presence"; fetchDiscordStatus(process.env.DISCORD_USER_ID).then((response) => { console.log(response); }); Result { status: 'online', avatar: 'some avatar url', username: 'morellexf13', discriminator: '0716', activities: [{ 'avatar': 'some avatar url', 'details': 'Editing index.js', 'name': 'Visual Studio Code' }] // Apps, Games & Spotify }
This project is licensed under the MIT License - see the LICENSE.md file for details.