Skip to content

Commit

Permalink
HOW
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 15, 2023
1 parent 0356ef7 commit dc754e3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/helpers/functions/missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,17 @@ export const computeAndUpdate = async (
const results = await compute(client, pack, edition, version, callback);
if (!client) return results;

console.log("compute results fetched");
const url = `${client.tokens.apiUrl}settings/channels.pack_progress`;
console.log(url);

console.log(`url to use by axios: ${client.tokens.apiUrl}settings/channels.pack_progress}`)

const packProgress = (
await axios.get(`${client.tokens.apiUrl}settings/channels.pack_progress`, { proxy: false })
).data;
const packProgress = (await axios.get(url)).data;

console.log(`pack progress fetched successfully: ${JSON.stringify(packProgress)}`);

const channel = client.channels.cache.get(packProgress[results[2].pack][results[2].edition]);
// channel doesn't exist or can't be fetched, return early
if (!channel) return results;

console.log(`channel fetched successfully: ${(channel as VoiceChannel).name}`);

// you can add different patterns depending on the channel type
switch (channel.type) {
case ChannelType.GuildVoice:
Expand Down

0 comments on commit dc754e3

Please sign in to comment.