From 0ddf6dac996e9b7a88483d90e1c68c2c36052259 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 28 Oct 2025 07:26:25 -0600 Subject: [PATCH] Use import everywhere, goofy --- index.js | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index c0a3dff..b7f9912 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ -require("dotenv").config({ quiet: true }); -const AMI = import("ami").AMISocket -const sock = new AMI({ +import dotenv from 'dotenv'; +dotenv.config({quiet: true}) +import AMISocket from 'ami'; +const sock = new AMISocket({ connect: { host: '127.0.0.1', port: 5038 @@ -11,7 +12,7 @@ const sock = new AMI({ }, events: true }) -const Discord = require("discord.js"); +import Discord from 'discord.js'; const hook = new Discord.WebhookClient({ url: process.env.DISCORD_WEBHOOK_URL }); const cfTypes = { diff --git a/package.json b/package.json index 46daa54..3aeccd6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "keywords": [], "author": "", "license": "ISC", - "type": "commonjs", + "type": "module", "dependencies": { "ami": "^1.0.0", "discord.js": "^14.24.0",