mirror of
https://github.com/danbulant/discord.js
synced 2026-06-16 21:21:11 +00:00
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:
parent
0589b7d7f1
commit
cd08a3b5a4
4 changed files with 1 additions and 24 deletions
|
|
@ -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'));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue