Slash Command and Context Menu

- Doc. comming soon
This commit is contained in:
March 7th
2022-03-25 22:57:21 +07:00
parent b9ba04fecc
commit fd4a6fa509
8 changed files with 118 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ const { Error } = require('../errors');
const SnowflakeUtil = require('../util/SnowflakeUtil');
const UserFlags = require('../util/UserFlags');
const { default: Collection } = require('@discordjs/collection');
const ApplicationCommandManager = require('../managers/ApplicationCommandManager');
/**
* Represents a user on Discord.
@@ -37,7 +38,7 @@ class User extends Base {
this.premiumSince = null;
this.premiumGuildSince = null;
this.mutualGuilds = new Collection();
this.applications = null;
this._patch(data);
}
@@ -58,6 +59,9 @@ class User extends Base {
* @type {?boolean}
*/
this.bot = Boolean(data.bot);
if (this.bot == true) {
this.applications = new ApplicationCommandManager(this.client, undefined, this);
}
} else if (!this.partial && typeof this.bot !== 'boolean') {
this.bot = false;
}