mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Added message sending
This commit is contained in:
@@ -26,10 +26,13 @@ class Message{
|
||||
// this is .add and not .get because it allows the bot to cache
|
||||
// users from messages from logs who may have left the server and were
|
||||
// not previously cached.
|
||||
console.log(mention);
|
||||
this.mentions.add(client.internal.users.add(new User(mention, client)));
|
||||
});
|
||||
}
|
||||
|
||||
toString(){
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
@@ -18,6 +18,10 @@ class PMChannel extends Equality{
|
||||
get lastMessage(){
|
||||
return this.messages.get("id", this.lastMessageID);
|
||||
}
|
||||
|
||||
toString(){
|
||||
return this.recipient.toString();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PMChannel;
|
||||
@@ -7,12 +7,17 @@ var PermissionOverwrite = require("./PermissionOverwrite.js");
|
||||
class ServerChannel extends Channel{
|
||||
constructor(data, client){
|
||||
super(data, client);
|
||||
this.name = data.name;
|
||||
this.type = data.type;
|
||||
this.permissionOverwrites = new Cache();
|
||||
data.permission_overwrites.forEach((permission) => {
|
||||
this.permissionOverwrites.add( new PermissionOverwrite(permission) );
|
||||
});
|
||||
}
|
||||
|
||||
toString(){
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerChannel;
|
||||
Reference in New Issue
Block a user