Add group chat functions, slight refactoring
This commit is contained in:
parent
594a65d5e8
commit
1b7376885d
1 changed files with 316 additions and 37 deletions
16
src/factories/ChatFactory.js
Normal file
16
src/factories/ChatFactory.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const PrivateChat = require('../structures/PrivateChat');
|
||||
const GroupChat = require('../structures/GroupChat');
|
||||
|
||||
class ChatFactory {
|
||||
static create(client, data) {
|
||||
if(data.isGroup) {
|
||||
return new GroupChat(client, data);
|
||||
}
|
||||
|
||||
return new PrivateChat(client, data);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChatFactory;
|
||||
Loading…
Reference in a new issue