mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 17:40:07 +00:00
ESLint stuff...
This commit is contained in:
@@ -1,30 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
const ServerChannel = require('./ServerChannel');
|
||||
const TextChannelDataStore = require('./datastore/TextChannelDataStore');
|
||||
const TextBasedChannel = require('./interface/TextBasedChannel');
|
||||
|
||||
class TextChannel extends ServerChannel {
|
||||
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
this.store = new TextChannelDataStore();
|
||||
}
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
this.store = new TextChannelDataStore();
|
||||
}
|
||||
|
||||
_cacheMessage(message) {
|
||||
let maxSize = this.client.options.max_message_cache;
|
||||
if (maxSize === 0) {
|
||||
// saves on performance
|
||||
return;
|
||||
}
|
||||
_cacheMessage(message) {
|
||||
const maxSize = this.client.options.max_message_cache;
|
||||
if (maxSize === 0) {
|
||||
// saves on performance
|
||||
return null;
|
||||
}
|
||||
|
||||
let storeKeys = Object.keys(this.store);
|
||||
if (storeKeys.length >= maxSize) {
|
||||
this.store.remove(storeKeys[0]);
|
||||
}
|
||||
const storeKeys = Object.keys(this.store);
|
||||
if (storeKeys.length >= maxSize) {
|
||||
this.store.remove(storeKeys[0]);
|
||||
}
|
||||
|
||||
return this.store.add('messages', message);
|
||||
}
|
||||
return this.store.add('messages', message);
|
||||
}
|
||||
}
|
||||
|
||||
TextBasedChannel.applyToClass(TextChannel);
|
||||
|
||||
Reference in New Issue
Block a user