mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01: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:
@@ -14,13 +14,11 @@ class ActionsManager {
|
|||||||
this.register(require('./ChannelUpdate'));
|
this.register(require('./ChannelUpdate'));
|
||||||
this.register(require('./GuildDelete'));
|
this.register(require('./GuildDelete'));
|
||||||
this.register(require('./GuildUpdate'));
|
this.register(require('./GuildUpdate'));
|
||||||
this.register(require('./GuildMemberGet'));
|
|
||||||
this.register(require('./GuildMemberRemove'));
|
this.register(require('./GuildMemberRemove'));
|
||||||
this.register(require('./GuildBanRemove'));
|
this.register(require('./GuildBanRemove'));
|
||||||
this.register(require('./GuildRoleCreate'));
|
this.register(require('./GuildRoleCreate'));
|
||||||
this.register(require('./GuildRoleDelete'));
|
this.register(require('./GuildRoleDelete'));
|
||||||
this.register(require('./GuildRoleUpdate'));
|
this.register(require('./GuildRoleUpdate'));
|
||||||
this.register(require('./UserGet'));
|
|
||||||
this.register(require('./UserUpdate'));
|
this.register(require('./UserUpdate'));
|
||||||
this.register(require('./UserNoteUpdate'));
|
this.register(require('./UserNoteUpdate'));
|
||||||
this.register(require('./GuildSync'));
|
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 })
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user