feat(User): presenceFetch()

v12: user.presence
This commit is contained in:
Cinnamon 2022-06-23 10:25:02 +07:00
parent 614c32fed6
commit f6f3274878
3 changed files with 18 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "discord.js-selfbot-v13", "name": "discord.js-selfbot-v13",
"version": "2.3.41", "version": "2.3.42",
"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

@ -472,6 +472,22 @@ class User extends Base {
return this; return this;
} }
/**
* Get presence (~ v12)
* @returns {Promise<Presence | null>}
*/
async presenceFetch() {
let data = null;
await Promise.all(
this.client.guilds.cache.map(async guild => {
const res_ = await guild.presences.resolve(this.id);
if (res_) return (data = res_);
return true;
}),
);
return data;
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel // These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */ /* eslint-disable no-empty-function */
send() {} send() {}