mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
Migrate most of the Client Data Store to Clien
This commit is contained in:
@@ -10,7 +10,7 @@ class ChannelDeleteAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
let channel = client.store.get('channels', data.id);
|
||||
let channel = client.channels.get(data.id);
|
||||
|
||||
if (channel) {
|
||||
client.store.killChannel(channel);
|
||||
|
||||
@@ -6,7 +6,7 @@ class ChannelUpdateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const channel = client.store.get('channels', data.id);
|
||||
const channel = client.channels.get(data.id);
|
||||
|
||||
if (channel) {
|
||||
const oldChannel = cloneObject(channel);
|
||||
|
||||
@@ -11,7 +11,7 @@ class GuildDeleteAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
let guild = client.store.get('guilds', data.id);
|
||||
let guild = client.guilds.get(data.id);
|
||||
|
||||
if (guild) {
|
||||
if (guild.available && data.unavailable) {
|
||||
@@ -26,7 +26,7 @@ class GuildDeleteAction extends Action {
|
||||
};
|
||||
}
|
||||
// delete guild
|
||||
client.store.remove('guilds', guild);
|
||||
client.guilds.delete(guild.id);
|
||||
this.deleted[guild.id] = guild;
|
||||
this.scheduleForDeletion(guild.id);
|
||||
} else if (this.deleted[data.id]) {
|
||||
|
||||
@@ -11,7 +11,7 @@ class GuildMemberRemoveAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.guild_id);
|
||||
const guild = client.guilds.get(data.guild_id);
|
||||
if (guild) {
|
||||
let member = guild.members.get(data.user.id);
|
||||
if (member) {
|
||||
|
||||
@@ -6,7 +6,7 @@ class GuildRoleCreate extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.guild_id);
|
||||
const guild = client.guilds.get(data.guild_id);
|
||||
|
||||
if (guild) {
|
||||
const already = guild.roles.get(data.role.id);
|
||||
|
||||
@@ -11,7 +11,7 @@ class GuildRoleDeleteAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.guild_id);
|
||||
const guild = client.guilds.get(data.guild_id);
|
||||
|
||||
if (guild) {
|
||||
let exists = guild.roles.get(data.role_id);
|
||||
|
||||
@@ -6,7 +6,7 @@ class GuildRoleUpdateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.guild_id);
|
||||
const guild = client.guilds.get(data.guild_id);
|
||||
|
||||
const roleData = data.role;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class GuildUpdateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.id);
|
||||
const guild = client.guilds.get(data.id);
|
||||
|
||||
if (guild) {
|
||||
const oldGuild = cloneObject(guild);
|
||||
|
||||
@@ -5,7 +5,7 @@ class MessageCreateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const channel = client.store.get('channels', data.channel_id);
|
||||
const channel = client.channels.get(data.channel_id);
|
||||
|
||||
if (channel) {
|
||||
const message = channel._cacheMessage(new Message(channel, data, client));
|
||||
|
||||
@@ -10,7 +10,7 @@ class MessageDeleteAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const channel = client.store.get('channels', data.channel_id);
|
||||
const channel = client.channels.get(data.channel_id);
|
||||
if (channel) {
|
||||
let message = channel.messages.get(data.id);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class MessageUpdateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const channel = client.store.get('channels', data.channel_id);
|
||||
const channel = client.channels.get(data.channel_id);
|
||||
|
||||
if (channel) {
|
||||
const message = channel.messages.get(data.id);
|
||||
|
||||
Reference in New Issue
Block a user