├── config.json ├── start.bat ├── package.json ├── index.js └── README.md /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "client_id":"" 3 | } 4 | -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | color 4 3 | title A simple discord RPC - https://github.com/peterhanania/discord-rpc 4 | :top 5 | cls 6 | node index.js 7 | pause 8 | goto top -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-rpc", 3 | "version": "1.0.0", 4 | "description": "a way of putting a status on discord!", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/peterhanania/discord-rpc.git" 12 | }, 13 | "keywords": [ 14 | "discord", 15 | "discord-rpc" 16 | ], 17 | "author": "peter hanania", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/peterhanania/discord-rpc/issues" 21 | }, 22 | "homepage": "https://github.com/peterhanania/discord-rpc#readme" 23 | } 24 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | 5 | Please read https://github.com/peterhanania/discord-rpc for a detailed tutorial. 6 | If you liked this repository, feel free to leave a star ⭐! 7 | 8 | */ 9 | 10 | 11 | var rpc = require("discord-rpc"); 12 | const config = require('./config.json'); 13 | 14 | const client = new rpc.Client({ transport: 'ipc' }); 15 | 16 | client.on('ready', () => { 17 | client.request('SET_ACTIVITY', { 18 | pid: process.pid, 19 | activity : { 20 | details : "A simple discord-rpc", // the description shown on your profile 21 | assets : { 22 | large_image : "image", // the image you put in rich presence and which will show on your profile 23 | large_text : "Hover me" // the text that will show once the imaged is hivered 24 | }, 25 | buttons : [{label : "Button1" , url : "https://github.com/peterhanania/discord-rpc"},{label : "Button2",url : "https://github.com/peterhanania/discord-rpc"}] // buttons in your profile 26 | } 27 | }) 28 | }); 29 | 30 | client.login({ clientId : config.client_id}); 31 | console.log(' --| Im ready |--') 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Discord RPC Client 3 |
4 |

5 | 6 | 7 |

8 | About 9 | • 10 | Installation 11 | • 12 | Setting Up 13 |

14 | 15 | ## About 16 | 17 | A way of showing a button status on discord. 18 | 19 | If you liked this repository, feel free to leave a star ⭐! 20 | 21 | 22 | ## Installation 23 | 24 | ``` 25 | git clone https://github.com/peterhanania/discord-rpc.git 26 | ``` 27 | 28 | 29 | ## Setting Up 30 | 31 | After installing the files, visit [discord's Developer Application](https://discord.com/developers/applications) and create a Bot. 32 | > Note: The application name you choose will be shown as the title on your profile. 33 | 34 | After creating your application, head to rich presence, then upload the picture you want on your profile and name it `image`. Also, keep refreshing the page after the upload until the image shows up. (sometimes the image disappears when you refresh since it haven't uploaded yet) 35 | 36 | Next head to `index.js`, and edit it as so: 37 | 38 | Details: The information you want to show under the title.
39 | largeImage: The image you uploaded to rich presence and will show on your profile.
40 | largeText: The text that will show once the image is hovered.
41 | 42 | Now for the buttons is where you put the button names and the links.
43 | 44 | 45 | Finally, copy the client ID of the bot and paste it in the `config.json` 46 | ``` 47 | { 48 | "client_id":"BOT_CLIENT_ID" 49 | } 50 | 51 | ``` 52 | 53 | Once done, you can launch the code with `start.bat` or `node index.js`. 54 | >Make sure discord is opened once you do. 55 | 56 | Any questions? DM me on Discord. 57 | --------------------------------------------------------------------------------