Skip to content

Commit 9176add

Browse files
committed
Remove GuildWrapper#get()
1 parent 992f015 commit 9176add

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/discord/GuildWrapper.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {BaseGuildTextChannel, Collection, DiscordjsErrorCodes, RESTJSONErrorCodes} from 'discord.js';
1+
import {BaseGuildTextChannel, DiscordjsErrorCodes, RESTJSONErrorCodes} from 'discord.js';
22
import RateLimiter from './RateLimiter.js';
33
import bot from '../bot/Bot.js';
44
import GuildSettings from '../settings/GuildSettings.js';
@@ -10,13 +10,6 @@ import logger from '../bot/Logger.js';
1010
*/
1111

1212
export default class GuildWrapper {
13-
14-
/**
15-
* Guild Cache
16-
* @type {Collection<import('discord.js').Snowflake, GuildWrapper>}
17-
*/
18-
static #cache = new Collection();
19-
2013
/**
2114
* Discord guild
2215
* @type {import('discord.js').Guild}
@@ -167,7 +160,7 @@ export default class GuildWrapper {
167160
/**
168161
* send a message to a channel
169162
* @param {import('discord.js').Snowflake} channelId
170-
* @param {import('discord.js').MessagePayload|import('discord.js').MessageOptions} options
163+
* @param {import('discord.js').MessagePayload|import('discord.js').MessageCreateOptions} options
171164
* @returns {Promise<?Message>} Discord message (if it was sent)
172165
*/
173166
async sendMessageToChannel(channelId, options) {
@@ -241,20 +234,4 @@ export default class GuildWrapper {
241234
database.query('DELETE FROM moderations WHERE guildid = ?', this.guild.id)
242235
]);
243236
}
244-
245-
/**
246-
* get a guild from cache or create a new one
247-
* @param {Guild} guild
248-
* @returns {GuildWrapper}
249-
* @deprecated
250-
*/
251-
static get(guild) {
252-
if (this.#cache.has(guild.id))
253-
return this.#cache.get(guild.id);
254-
else {
255-
const newGuild = new GuildWrapper(guild);
256-
this.#cache.set(guild.id, newGuild);
257-
return newGuild;
258-
}
259-
}
260237
}

0 commit comments

Comments
 (0)