Skip to content

morellexf13/node-discord-presence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


🦀

Node Discord Presence


Handle Discord presence in your site with ease

Build status Version License Package Monthly Downloads Lanyard

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.


🌊 Getting Started

To get started with this project, follow these steps:

  1. Join Lanyard Discord

  2. Copy you Discord User ID to a .env file

  3. Go to your project and run:

    npm install node-discord-presence
    
  4. 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
    }

License

This project is licensed under the MIT License - see the LICENSE.md file for details.