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",