Skip to content

Commit

Permalink
Merge pull request #83 from yoggys/master
Browse files Browse the repository at this point in the history
Remove Eris from dependencies
sylveon authored Jul 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents f0532d2 + 632fe38 commit 5eca0fa
Showing 3 changed files with 21 additions and 88 deletions.
32 changes: 21 additions & 11 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Eris from "eris";
import fetch from 'node-fetch';
import fs from "fs";
import path from "path";
import process from "process";
import { fileURLToPath } from 'url';
import { API_ENDPOINT } from "./func/helpers/discord-helpers.js";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

@@ -45,16 +46,25 @@ async function main() {
}

if(!process.env.DISCORD_WEBHOOK_URL) {
// Make sure the bot connected to the gateway at least once.
const bot = new Eris(process.env.DISCORD_BOT_TOKEN);
bot.on("ready", () => bot.disconnect());

try {
await bot.connect();
} catch (e) {
console.log(e);
process.exit(1);
}
// Make sure the bot token & env variables are valid.
const init = {
method: "GET",
headers: {
"Authorization": `Bot ${process.env.DISCORD_BOT_TOKEN}`,
},
};

const results = await Promise.all([
fetch(`${API_ENDPOINT}/guilds/${process.env.GUILD_ID}/bans?limit=1`, init),
fetch(`${API_ENDPOINT}/channels/${process.env.APPEALS_CHANNEL}`, init),
]);

results.forEach(result => {
if(!result.ok) {
console.log(result.statusText);
process.exit(1);
}
});
}
}

76 changes: 0 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"type": "module",
"dependencies": {
"eris": "^0.16.1",
"jsonwebtoken": "^9.0.0",
"node-fetch": "^3.2.10"
}

0 comments on commit 5eca0fa

Please sign in to comment.