Skip to content

Commit

Permalink
feat(mq): Remove gateway info
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Crespi committed Dec 10, 2019
1 parent 2c806bc commit 71b6faa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
17 changes: 0 additions & 17 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ export class IMClient extends Client {

public startedAt: Moment;
public gatewayConnected: boolean;
public gatewayInfo: GatewayInfo;
public gatewayInfoCachedAt: Moment;
public activityInterval: NodeJS.Timer;
public voiceConnections: LavaPlayerManager;

Expand Down Expand Up @@ -548,22 +546,7 @@ export class IMClient extends Client {
return this.counts;
}

private async updateGatewayInfo() {
if (
!this.gatewayInfoCachedAt ||
moment()
.subtract(4, 'hours')
.isAfter(this.gatewayInfoCachedAt)
) {
console.log('Fetching gateway info...');
this.gatewayInfo = (await this.getBotGateway()) as GatewayInfo;
this.gatewayInfoCachedAt = moment();
}
}

public async setActivity() {
await this.updateGatewayInfo();

const status = this.settings.activityStatus;

if (!this.settings.activityEnabled) {
Expand Down
2 changes: 0 additions & 2 deletions src/framework/services/RabbitMq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ export class RabbitMqService {
id: 'status',
cmd: ShardCommand.STATUS,
connected: this.client.gatewayConnected,
gateway: this.client.gatewayInfo,
gatewayLastUpdate: this.client.gatewayInfoCachedAt ? this.client.gatewayInfoCachedAt.toISOString() : null,
guilds: this.client.guilds.size,
error: err ? err.message : null,
tracking: {
Expand Down

0 comments on commit 71b6faa

Please sign in to comment.