Constructor
new UserManager(client, id) → {UserManager}
Parameters:
Name | Type | Description |
---|---|---|
client | object | the Application Client |
id | string | the id of the user |
Returns:
- Type:
- UserManager
Example
// You can use this way
const manager = new UserManager(<Client>);
const user = await manager.fetch(userid);
console.log(user);
// Or this way
const manager = new UserManager(<Client>, userid);
const user = await manager.fetch();
console.log(user);
Members
id :string|null
the id of the user
Type:
- string |
null
Methods
(async) fetch(userId) → {Promise.<object>}
Fetch the user from Discord
Parameters:
Name | Type | Description |
---|---|---|
userId | string | |
Returns:
- Type:
- Promise.<object>
(async) fetchMyApplication() → {Promise.<object>}
Fetch the current bot's application (Pretty useful for guild count!)
Returns:
- Type:
- Promise.<object>
(async) fetchMyself() → {Promise.<object>}
Fetch the current bot from Discord
Returns:
- Type:
- Promise.<object>
(async) sendDM(userId, data) → {Promise.<object>}
Send a message to the user
Parameters:
Name | Type | Description |
---|---|---|
userId | string | | the user id |
data | object | the message payload |
Returns:
- Type:
- Promise.<object>