mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Updated bot and added some more helpful features, such as isPM to messages to discover whether a message is from a PM
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var User = require( "./user.js" ).User;
|
||||
var List = require( "./list.js" ).List;
|
||||
var PMChannel = require( "./PMChannel.js" ).PMChannel;
|
||||
|
||||
exports.Message = function( time, author, content, channel, id, mentions, everyoneMentioned ) {
|
||||
|
||||
@@ -27,6 +28,10 @@ exports.Message = function( time, author, content, channel, id, mentions, everyo
|
||||
}
|
||||
}
|
||||
|
||||
exports.Message.prototype.isPM = function() {
|
||||
return ( this.channel instanceof PMChannel );
|
||||
}
|
||||
|
||||
exports.Message.prototype.isMentioned = function( user ) {
|
||||
return ( this.mentions.filter( "id", user.id ).length > 0 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user