chore(release): version

This commit is contained in:
Cinnamon
2022-06-26 13:40:26 +07:00
parent c097deeab4
commit 736238f3df
11 changed files with 78 additions and 29 deletions

View File

@@ -94,7 +94,8 @@ class User extends Base {
*/
this.bot = Boolean(data.bot);
if (this.bot === true) {
this.application = new ClientApplication(this.client, { id: this.id });
this.application = new ClientApplication(this.client, { id: this.id }, this);
this.botInGuildsCount = null;
}
} else if (!this.partial && typeof this.bot !== 'boolean') {
this.bot = false;
@@ -159,6 +160,14 @@ class User extends Base {
*/
this.flags = new UserFlags(data.public_flags);
}
if ('approximate_guild_count' in data) {
/**
* Check how many guilds the bot is in (Probably only approximate) (application.fetch() first)
* @type {?number}
*/
this.botInGuildsCount = data.approximate_guild_count;
}
}
/**
@@ -487,18 +496,6 @@ class User extends Base {
return data;
}
async fetchBotInfo() {
if (this.client.user.bot) throw new Error('INVALID_BOT_METHOD');
if (!this.bot) throw new Error('BOT_ONLY');
const result = await this.client.api.oauth2.authorize.get({
query: {
client_id: this.id,
scope: 'bot',
},
});
console.log(result);
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */
send() {}