diff --git a/platforms/cytube.js b/platforms/cytube.js index 1c5feec1..48007415 100644 --- a/platforms/cytube.js +++ b/platforms/cytube.js @@ -581,11 +581,10 @@ module.exports = class CytubePlatform extends require("./template.js") { /** * Fetches the userlist for a given cytube client. - * @param {string} channelIdentifier + * @param {Channel} channelData * @returns {string[]} */ - populateUserList (channelIdentifier) { - const channelData = sb.Channel.get(channelIdentifier, this.platform); + populateUserList (channelData) { const client = this.clients.get(channelData.ID); if (!client) { throw new sb.Error({ diff --git a/platforms/discord.js b/platforms/discord.js index a5ad4e6b..a9e4d67c 100644 --- a/platforms/discord.js +++ b/platforms/discord.js @@ -809,8 +809,8 @@ module.exports = class DiscordPlatform extends require("./template.js") { ); } - async populateUserList (channelIdentifier) { - const channel = await this.client.channels.fetch(channelIdentifier); + async populateUserList (channelData) { + const channel = await this.client.channels.fetch(channelData.Name); const guild = await channel.guild.fetch(); await Promise.all([ diff --git a/platforms/template.js b/platforms/template.js index df930978..884324d2 100644 --- a/platforms/template.js +++ b/platforms/template.js @@ -287,7 +287,8 @@ class Platform { return cacheData; } - const userList = await this.populateUserList(channelData.Name); + const userList = await this.populateUserList(channelData); + await sb.Cache.setByPrefix(key, userList, { expiry: 300_000 // 5 minutes }); diff --git a/platforms/twitch.js b/platforms/twitch.js index f9317ae1..fe1155d6 100644 --- a/platforms/twitch.js +++ b/platforms/twitch.js @@ -1248,8 +1248,7 @@ module.exports = class TwitchPlatform extends require("./template.js") { ]; } - async populateUserList (channelIdentifier) { - const channelData = sb.Channel.get(channelIdentifier, this); + async populateUserList (channelData) { return await getActiveUsernamesInChannel(channelData); }