mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
Remove all data stores! Move to maps
This commit is contained in:
@@ -4,7 +4,7 @@ class ChannelCreateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const channel = client.store.newChannel(data);
|
||||
const channel = client.dataManager.newChannel(data);
|
||||
|
||||
return {
|
||||
channel,
|
||||
|
||||
@@ -13,7 +13,7 @@ class ChannelDeleteAction extends Action {
|
||||
let channel = client.channels.get(data.id);
|
||||
|
||||
if (channel) {
|
||||
client.store.killChannel(channel);
|
||||
client.dataManager.killChannel(channel);
|
||||
this.deleted[channel.id] = channel;
|
||||
this.scheduleForDeletion(channel.id);
|
||||
} else if (this.deleted[data.id]) {
|
||||
|
||||
@@ -7,22 +7,22 @@ class UserUpdateAction extends Action {
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
|
||||
if (client.store.user) {
|
||||
if (client.store.user.equals(data)) {
|
||||
if (client.user) {
|
||||
if (client.user.equals(data)) {
|
||||
return {
|
||||
old: client.store.user,
|
||||
updated: client.store.user,
|
||||
old: client.user,
|
||||
updated: client.user,
|
||||
};
|
||||
}
|
||||
|
||||
const oldUser = cloneObject(client.store.user);
|
||||
client.store.user.setup(data);
|
||||
const oldUser = cloneObject(client.user);
|
||||
client.user.setup(data);
|
||||
|
||||
client.emit(Constants.Events.USER_UPDATE, oldUser, client.store.user);
|
||||
client.emit(Constants.Events.USER_UPDATE, oldUser, client.user);
|
||||
|
||||
return {
|
||||
old: oldUser,
|
||||
updated: client.store.user,
|
||||
updated: client.user,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user