mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-21 05:53:30 +01:00
Beautify and sendMessage also takes channel IDs
This commit is contained in:
10
index.js
10
index.js
@@ -383,10 +383,18 @@ exports.Client.prototype.sendMessage = function( channel, message, cb, _mentions
|
||||
}
|
||||
}
|
||||
|
||||
if( channel instanceof Message ){
|
||||
if ( channel instanceof Message ) { //if the channel is actually a message, get the channel
|
||||
channel = channel.channel;
|
||||
}
|
||||
|
||||
if ( typeof channel === 'string' || channel instanceof String || !isNaN( channel ) ) {
|
||||
//Channel is an ID
|
||||
var chanId = channel;
|
||||
channel = {
|
||||
id : chanId
|
||||
}
|
||||
}
|
||||
|
||||
var cb = cb || function() {};
|
||||
|
||||
if ( _mentions === false ) {
|
||||
|
||||
Reference in New Issue
Block a user