Skip to content

Commit

Permalink
fix(Guild): correctly override shardID
Browse files Browse the repository at this point in the history
  • Loading branch information
Garifullin Ruslan committed Jan 5, 2021
1 parent a03cf50 commit c7bce6b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/patches/Guild.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable class-methods-use-this */
import { ChannelManager, Snowflake, Client, Permissions } from 'discord.js';
import { patchAfter, patchClass } from '../utilities/Patcher';
import { patchClass } from '../utilities/Patcher';
import { ClientUserGuildSettings } from './ClientUserGuildSettings';

const Guild = require('discord.js/src/structures/Guild');
Expand All @@ -13,7 +14,13 @@ class GuildPatch {

id?: Snowflake;

shardID: number = 0;
get shardID() {
return 0;
}

set shardID(_value) {
/**/
}

/**
* Get a guild setting
Expand Down Expand Up @@ -80,12 +87,6 @@ class GuildPatch {
return this.getGuildSetting('suppressEveryone');
}

_patch = patchAfter(proto._patch, () => {
setTimeout(() => {
this.shardID = 0;
}, 0);
});

subscribeToTypingEvent() {
void this.client?.shard?.send({
op: 14,
Expand Down

0 comments on commit c7bce6b

Please sign in to comment.