refactor(Actions): remove obsolete user and guild member get actions (#2061)

The UserGetAction was never used.
The GuildMemberGetAction was only once used.
Easily replaced with a shorter and more comprehensible line. (Also consistent with the rest of the library)
This commit is contained in:
SpaceEEC
2017-10-26 09:52:03 +02:00
committed by Amish Shah
parent 0589b7d7f1
commit cd08a3b5a4
4 changed files with 1 additions and 24 deletions

View File

@@ -14,13 +14,11 @@ class ActionsManager {
this.register(require('./ChannelUpdate'));
this.register(require('./GuildDelete'));
this.register(require('./GuildUpdate'));
this.register(require('./GuildMemberGet'));
this.register(require('./GuildMemberRemove'));
this.register(require('./GuildBanRemove'));
this.register(require('./GuildRoleCreate'));
this.register(require('./GuildRoleDelete'));
this.register(require('./GuildRoleUpdate'));
this.register(require('./UserGet'));
this.register(require('./UserUpdate'));
this.register(require('./UserNoteUpdate'));
this.register(require('./GuildSync'));

View File

@@ -1,10 +0,0 @@
const Action = require('./Action');
class GuildMemberGetAction extends Action {
handle(guild, data) {
const member = guild.members.create(data);
return { member };
}
}
module.exports = GuildMemberGetAction;

View File

@@ -1,11 +0,0 @@
const Action = require('./Action');
class UserGetAction extends Action {
handle(data) {
const client = this.client;
const user = client.users.create(data);
return { user };
}
}
module.exports = UserGetAction;

View File

@@ -542,7 +542,7 @@ class Guild extends Base {
}
}
return this.client.api.guilds(this.id).members(user.id).put({ data: options })
.then(data => this.client.actions.GuildMemberGet.handle(this, data).member);
.then(data => this.members.create(data));
}
/**