Methods - Channels
sendMessage |
Send a message to the given channel or user. |
client.sendMessage( {opts} [, callback] );
- opts
- to: A channel or User ID.
- message: The message content.
- tts: Optional Boolean, should the message be spoken by Discord, defaults to false.
- nonce: Optional number used when sending the message to Discord, it's purpose lies in identifying if message was received.
- typing: Optional Boolean to appear as if the client was typing the message, based on message length, defaults to false.
- callback
uploadFile |
Send a file to the given channel or user. |
client.uploadFile( {opts} [, callback] );
- opts
- to: A channel or User ID.
- file: Filename or Buffer.
- filename: When using a filename it is optional.
- message: What you would like to say along with the uploaded file, optional.
- callback
getMessage |
Get a message from the given channel. |
client.getMessage( {opts} [, callback] );
- opts
- channelID: A channel or User ID.
- messageID: A message ID.
- callback
getMessages |
Get an array of messages from the given channel. |
client.getMessages( {opts} [, callback] );
- opts
- channelID: A channel or User ID.
- before: A message ID, optional.
- after: A message ID, optional.
- limit: An optional number, the Discord default is 50, limit is 100.
- callback
editMessage |
Edit a message sent by the client. |
client.editMessage( {opts} [, callback] );
- opts
- channelID: A channel or User ID.
- messageID: The ID of the message to edit.
- message: What to edit the message to.
- callback
simulateTyping |
Simulate the client typing in the given channel. |
client.simulateTyping( channelID [, callback] );
- channelID: A channel or User ID.
- callback
deleteMessages |
Delete an array of messages from the given channel. |
client.deleteMessages( {opts} [, callback] );
- opts
- channelID: A channel or User ID.
- messageIDs: An array of messages to delete.
- callback
deleteMessage |
Delete a message from the given channel. |
client.deleteMessage( {opts} [, callback] );
- opts
- channelID: A channel or User ID.
- messageID: The ID of the message to delete.
- callback
pinMessage |
Pin a message to the channel. |
client.pinMessage( {opts} [, callback]);
- opts
- channelID: A channel ID.
- messageID: The ID of a message.
- callback
deletePinnedMessage |
Remove a pinned message from the channel. |
client.deletePinnedMessage( {opts} [, callback]);
- opts
- channelID: A channel ID.
- messageID: The ID of a message.
- callback
getPinnedMessages |
Get the pinned messages of a channel. |
client.getPinnedMessages( {opts} [, callback]);