This commit is contained in:
March 7th 2022-03-21 22:24:08 +07:00
parent 4d247119f4
commit 0cf642395f
7 changed files with 25 additions and 6 deletions

View File

@ -146,7 +146,26 @@ Guild
<details> <details>
<summary><strong>Click to show</strong></summary> <summary><strong>Click to show</strong></summary>
- Document come soon ! Custom Status
```js
const { RichPresence } = require('discord.js-selfbot-v13');
const custom = new RichPresence.CustomStatus()
.setUnicodeEmoji('🎮') // Set Unicode Emoji [Using one]
.setDiscordEmoji({ // Set Custom Emoji (Nitro) [Using one]
name: 'nom',
id: '737373737373737373',
animated: false,
})
.setState('Testing') // Name of presence
.toDiscord();
client.user.setActivity(custom);
```
Rich Presence
```js
Come back soon !
```
</details> </details>
## More features ## More features

View File

@ -1,6 +1,6 @@
{ {
"name": "discord.js-selfbot-v13", "name": "discord.js-selfbot-v13",
"version": "0.1.8", "version": "0.1.9",
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
"main": "./src/index.js", "main": "./src/index.js",
"types": "./typings/index.d.ts", "types": "./typings/index.d.ts",

View File

@ -520,7 +520,7 @@ module.exports = (function (e) {
name: 'Custom Status', name: 'Custom Status',
emoji: null, emoji: null,
type: 4, type: 4,
state: '??', state: null,
}), }),
e && (this.game = e); e && (this.game = e);
} }
@ -1843,7 +1843,7 @@ module.exports = (function (e) {
}); });
}, },
function (e, t) { function (e, t) {
e.exports = require("../package.json"); e.exports = require("../../../package.json");
}, },
]); ]);

View File

@ -59,6 +59,7 @@ module.exports = (client, { d: data }, shard) => {
} else { } else {
custom_status.setUnicodeEmoji(res.rawSetting.custom_status.emoji_name); custom_status.setUnicodeEmoji(res.rawSetting.custom_status.emoji_name);
} }
custom_status.setState(res.rawSetting.custom_status?.text);
} }
client.user.setPresence({ client.user.setPresence({
activities: custom_status ? [custom_status.toDiscord()] : [], activities: custom_status ? [custom_status.toDiscord()] : [],

View File

@ -9,7 +9,7 @@ exports.ShardingManager = require('./sharding/ShardingManager');
exports.WebhookClient = require('./client/WebhookClient'); exports.WebhookClient = require('./client/WebhookClient');
// Utilities // Utilities
exports.RichPresence = require('../RPC/index'); exports.RichPresence = require('./RPC/index');
exports.ActivityFlagsBitField = require('./util/ActivityFlagsBitField'); exports.ActivityFlagsBitField = require('./util/ActivityFlagsBitField');
exports.ApplicationFlagsBitField = require('./util/ApplicationFlagsBitField'); exports.ApplicationFlagsBitField = require('./util/ApplicationFlagsBitField');
exports.BaseManager = require('./managers/BaseManager'); exports.BaseManager = require('./managers/BaseManager');

View File

@ -21,7 +21,6 @@ class ClientPresence extends Presence {
set(presence) { set(presence) {
const packet = this._parse(presence); const packet = this._parse(presence);
this._patch(packet); this._patch(packet);
console.log(packet);
if (typeof presence.shardId === 'undefined') { if (typeof presence.shardId === 'undefined') {
this.client.ws.broadcast({ op: GatewayOpcodes.PresenceUpdate, d: packet }); this.client.ws.broadcast({ op: GatewayOpcodes.PresenceUpdate, d: packet });
} else if (Array.isArray(presence.shardId)) { } else if (Array.isArray(presence.shardId)) {