mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Started rewrite
This commit is contained in:
34
src/Client/Client.js
Normal file
34
src/Client/Client.js
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
var InternalClient = require("./InternalClient.js");
|
||||
var EventEmitter = require("events");
|
||||
|
||||
class Client extends EventEmitter{
|
||||
/*
|
||||
this class is an interface for the internal
|
||||
client.
|
||||
*/
|
||||
constructor(options){
|
||||
super(options);
|
||||
this.internal = new InternalClient(this);
|
||||
}
|
||||
|
||||
login(email, password, cb=function(err, token){}){
|
||||
var self = this;
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
self.internal.login(email, password)
|
||||
.then((token)=>{
|
||||
|
||||
})
|
||||
.catch((e)=>{
|
||||
cb(e);
|
||||
reject(e);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
Reference in New Issue
Block a user