Advertisement
Tarna256

Untitled

Mar 8th, 2022
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import { Client } from '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. client.setActivity({
  25. details: `Hello Krish`,
  26. state: `Click Me`,
  27. startTimestamp,
  28. buttons: [
  29. {
  30. label: 'Click Me',
  31. url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
  32. }
  33. ]
  34. });
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement