Advertisement
Tarna256

Untitled

Mar 9th, 2022
839
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { Client } = require('discord-rpc');
  2.  
  3. const clientId = '949816401114329118';
  4. const clientSecret = 'c2CSyGIZg1zNr6wltDhXvnyymRmAiyjN';
  5. const scopes = ['rpc'];
  6.  
  7. const client = new Client({ transport: 'ipc' })
  8.  
  9. const startTimestamp = Date.now();
  10.  
  11. client.on('ready', () => {
  12.   console.log('Logged in as', client.application.name);
  13.   console.log('Authed for user', client.user.username);
  14. });
  15.  
  16.   // Log in to RPC with client id
  17. client.login({ clientId, scopes, clientSecret, redirectUri: 'https://google.com' }).catch(console.log);
  18.  
  19. client.on('ready', () => {
  20.   setActivity();
  21. })
  22.  
  23. async function setActivity() {
  24.  
  25.   client.setActivity({
  26.     startTimestamp,
  27.     largeImageKey: 'hypixel',
  28.     buttons: [
  29.       {
  30.         label: 'Play Here!',
  31.         url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
  32.       }
  33.     ]
  34.   });
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement