Skip to content

Commit

Permalink
RPC with Custom Image
Browse files Browse the repository at this point in the history
and fix something
  • Loading branch information
aiko-chan-ai committed Apr 16, 2022
1 parent 70637bb commit e9ba80a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
30 changes: 29 additions & 1 deletion Document/User.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,39 @@ client.user.setActivity(r.toDiscord().game);
<img src='https://cdn.discordapp.com/attachments/820557032016969751/955767445220646922/unknown.png'>

Rich Presence with Twitch / Spotify

```js
Update soon ~
```

<strong>New: You can now add custom images for RPC !</strong>
> Tutorial:
+ Step 1: Send photos by embed.thumbnail
```js
const embed = new MessageEmbed().setThumbnail('image url');
const msg = await channel.send({ embeds: [embed] });
```
+ Step 2: Get proxyURL from message.embeds[0].thumbnail.proxyURL
```js
const proxyURL = msg.embeds[0].thumbnail.proxyURL;
```
+ Step 3: Put the URL in the constructor
```js
const RPC = require('discord-rpc-contructor');
const r = new RPC.Rpc()
.setApplicationId('817229550684471297')
.setType(0)
.setState('State')
.setName('Name')
.setDetails('Details')
.setAssetsLargeImage(proxyURL) // Custom image
.setAssetsLargeText('Youtube')
.setAssetsSmallImage('895316294222635008')
.setAssetsSmallText('Bot')
client.user.setActivity(r.toDiscord().game);
```



<strong>How to get AssetID ?</strong>

Code
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord.js-selfbot-v13",
"version": "1.3.7",
"version": "1.3.8",
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
"main": "./src/index.js",
"types": "./typings/index.d.ts",
Expand Down Expand Up @@ -57,7 +57,7 @@
"chalk": "^4.1.2",
"discord-api-types": "^0.31.1",
"discord-bettermarkdown": "^1.1.0",
"discord-rpc-contructor": "^1.0.5",
"discord-rpc-contructor": "^1.1.0",
"discord.js": "^13.6.0",
"form-data": "^4.0.0",
"json-bigint": "^1.0.0",
Expand Down
3 changes: 0 additions & 3 deletions src/managers/ClientUserSettingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class ClientUserSettingManager {
* @returns {boolean}
*/
async setDisplayCompactMode(value) {
if (this.client.bot) throw new Error('INVALID_BOT_METHOD');
if (typeof value !== 'boolean' && value !== null && typeof value !== 'undefined') {
throw new TypeError('INVALID_TYPE', 'value', 'boolean | null | undefined', true);
}
Expand All @@ -197,7 +196,6 @@ class ClientUserSettingManager {
* @returns {theme}
*/
async setTheme(value) {
if (this.client.bot) throw new Error('INVALID_BOT_METHOD');
const validValues = ['dark', 'light'];
if (typeof value !== 'string' && value !== null && typeof value !== 'undefined') {
throw new TypeError('INVALID_TYPE', 'value', 'string | null | undefined', true);
Expand Down Expand Up @@ -296,7 +294,6 @@ class ClientUserSettingManager {
* @returns {locale}
*/
async setLocale(value) {
if (this.client.bot) throw new Error('INVALID_BOT_METHOD');
if (typeof value !== 'string') {
throw new TypeError('INVALID_TYPE', 'value', 'string', true);
}
Expand Down

0 comments on commit e9ba80a

Please sign in to comment.