Added leave server and other stuff

This commit is contained in:
hydrabolt
2015-11-01 13:34:59 +00:00
parent 0fe42c61da
commit 1efc2eb505
14 changed files with 145 additions and 14 deletions

View File

@@ -15,6 +15,21 @@ class Resolver {
constructor(internal) {
this.internal = internal;
}
resolveServer(resource){
if(resource instanceof Server){
return resource;
}else if(resource instanceof ServerChannel){
return resource.server;
}else if(resource instanceof String || typeof resource === "string"){
return this.internal.servers.get("id", resource);
}else if(resource instanceof Message){
if(resource.channel instanceof TextChannel){
return resource.server;
}
}
return null;
}
resolveFile(resource) {
if (typeof resource === "string" || resource instanceof String) {