diff --git a/index.js b/index.js index baf8a1c..5010a10 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,9 @@ import { Client, Collection, GatewayIntentBits } from 'discord.js'; import { config } from 'dotenv'; config(); +import { igdb } from './igdb.js'; +export const igdbHelper = new igdb(); + // Create a new client instance const client = new Client({ intents: [GatewayIntentBits.Guilds] }); @@ -49,23 +52,4 @@ for (const file of eventFiles) { } } -fetch( - `https://id.twitch.tv/oauth2/token?client_id=${process.env.igdbClientId}&client_secret=${process.env.igdbClientSecret}&grant_type=client_credentials`, - { - method: 'POST', - }, -) -.then(r => r.json().then(data => ({ status: r.status, headers: r.headers, body: data }))) -.then(resp => { - if (resp.status != 200) { - console.log('Failed with ', resp.status, resp.body); - return; - } - console.log(resp.body.access_token); -}) -.catch(err => { - console.error(err); -}) -.finally(); - client.login(process.env.token); \ No newline at end of file