UserManager
classe · Source
Manages API methods for users and stores their cache.
Extends: CachedManager
Properties
cache
The cache of this manager Source
_cache
The private cache of items for this manager. Source
holds
The data structure belonging to this manager. Source
client
The client that instantiated this Manager Source
Methods
dmChannel
The DM between the client's user and a user Parameters
| Name | Type | Description |
|---|---|---|
userId | Snowflake | The user id |
Returns: DMChannelSource
createDM
Creates a DMChannel between the client and a user. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The UserResolvable to identify |
options? | BaseFetchOptions | Additional options for this fetch |
Returns: Promise<DMChannel>Source
deleteDM
Deletes a DMChannel (if one exists) between the client and a user. Resolves with the channel if successful. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The UserResolvable to identify |
Returns: Promise<DMChannel>Source
fetch
Obtains a user from Discord, or the user cache if it's already available. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The user to fetch |
options? | BaseFetchOptions | Additional options for this fetch |
Returns: Promise<User>Source
send
Sends a message to a user. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The UserResolvable to identify |
options | string | MessagePayload | MessageOptions | The options to provide |
Returns: Promise<Message>Source
resolve
Resolves a UserResolvable to a User object. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The UserResolvable to identify |
Returns: UserSource
resolveId
Resolves a UserResolvable to a User id. Parameters
| Name | Type | Description |
|---|---|---|
user | UserResolvable | The UserResolvable to identify |
Returns: SnowflakeSource