new Client()
- Source:
Properties:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channels |
Store | Where channels are being cached |
||||||||||||||||||||||||||
guilds |
Store | Where guilds are being cached |
||||||||||||||||||||||||||
token |
String | The token of the client |
||||||||||||||||||||||||||
users |
Store | Where users are being cached |
||||||||||||||||||||||||||
options |
Object |
<optional> |
Options for the Discord Client Properties
|
Extends
- EventEmitter
Methods
createDM(user) → {Promise.<DMChannel>}
- Source:
Creates a DMChannel between a user
Parameters:
Name | Type | Description |
---|---|---|
user |
Snowflake | The id of the recipient for the DM |
Returns:
- Type
- Promise.<DMChannel>
createEmbed(channel, embed) → {Promise.<Message>}
- Source:
Creates an embed to a channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
Snowflake | The id of the channel to send a message to |
embed |
Object | The embed to send |
Returns:
- Type
- Promise.<Message>
createGuild(name, optionsopt) → {Promise.<Guild>}
- Source:
Creates a guild
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
String | The name for the new guild |
|||||||||||||
options |
Object |
<optional> |
Options for the new guild Properties
|
Returns:
- Type
- Promise.<Guild>
createMessage(channel, content) → {Promise.<Message>}
- Source:
Creates a message to a channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
Snowflake | The id of the channel to send a message to |
content |
String | The content to send |
Returns:
- Type
- Promise.<Message>
customLog(type, color, message) → {Object}
- Source:
Make your own log with your own type and color
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The type of the log, can be anything |
color |
String | The color of the type |
message |
String | The message to log |
Returns:
- Type
- Object
getUser(user) → {Promise.<User>}
- Source:
Fetches the user from cache, if it doesn't exist use the REST API to fetch it and add to the cache
Parameters:
Name | Type | Description |
---|---|---|
user |
Snowflake | The id of the user to fetch |
Returns:
- Type
- Promise.<User>
(async) initiate(token) → {Void}
- Source:
This will start connecting to the gateway using the given bot token
Parameters:
Name | Type | Description |
---|---|---|
token |
String | The token of the user |
Returns:
- Type
- Void
leaveGuild(guild) → {Promise.<Boolean>}
- Source:
Makes the bot leave the guild
Parameters:
Name | Type | Description |
---|---|---|
guild |
Snowflake | The id of the guild |
Returns:
Will return true if it's a success
- Type
- Promise.<Boolean>
log(type, message) → {Object}
- Source:
Logs something to the console that is colored.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The type of the log |
message |
String | The message to log |
Returns:
- Type
- Object
rgbLog(type, message, optionsopt) → {Object}
- Source:
Make your own log with your own type and color using RGB
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
String | The type of the log, can be anything |
|||||||||||||||||||||
message |
String | The message to log |
|||||||||||||||||||||
options |
Object |
<optional> |
The options for the RGB Color Properties
|
Returns:
- Type
- Object
start(token) → {Void}
- Source:
- Deprecated:
- Yes
This will start connecting to the gateway using the given bot token
Parameters:
Name | Type | Description |
---|---|---|
token |
String | The token of the user |
Returns:
- Type
- Void
Events
GUILD_MEMBER_ADD
- Source:
Properties:
Name | Type | Description |
---|---|---|
member |
Member | The member that joined |
Emitted when a guild member joins a guild
GUILD_MEMBER_REMOVE
- Source:
Properties:
Name | Type | Description |
---|---|---|
member |
Member | The member that left |
Emitted when a guild member leaves a guild
GUILD_MEMBER_UPDATE
- Source:
Properties:
Name | Type | Description |
---|---|---|
member |
Member | The member that got updated |
Emitted when a guild gets updated
GUILD_ROLE_CREATE
- Source:
Properties:
Name | Type | Description |
---|---|---|
role |
Role | The new role created |
GUILD_ROLE_DELETE
- Source:
Properties:
Name | Type | Description |
---|---|---|
role |
Role | The role deleted |
GUILD_ROLE_UPDATE
- Source:
Properties:
Name | Type | Description |
---|---|---|
role |
Role | The role updated |
PRESENCE_UPDATE
- Source:
Properties:
Name | Type | Description |
---|---|---|
data |
Object | The data of the presence |
Emitted when a user changes his presence or user info
READY
- Source:
Emiited once all shards are ready
READY
- Source:
Emiited once all shards are ready
READY
- Source:
Emiited once all shards are ready
SHARD_LOADING
- Source:
Properties:
Name | Type | Description |
---|---|---|
shard |
Shard.<Id> | Returns a partial Shard Object, contains an id only |
Emitted once a Shard is being loaded
SHARD_READY
- Source:
Properties:
Name | Type | Description |
---|---|---|
shard |
Object | The data of the shard |
Emitted once a shard is ready
SHARD_READY
- Source:
Properties:
Name | Type | Description |
---|---|---|
shard |
Object | The data of the shard |
Emitted once a shard is ready