diff --git a/index.js b/index.js index 49f9468..b4e04b8 100644 --- a/index.js +++ b/index.js @@ -1,20 +1,9 @@ -import * as baileys from '@whiskeysockets/baileys'; -const { - default: makeWASocket, - useMultiFileAuthState, - DisconnectReason, - fetchLatestBaileysVersion -} = baileys; - -import express from 'express'; -import { Boom } from '@hapi/boom'; -import qrcode from 'qrcode'; -import fs from 'fs'; -import path from 'path'; -import { fileURLToPath } from 'url'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const { default: makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion } = require('@whiskeysockets/baileys'); +const express = require('express'); +const { Boom } = require('@hapi/boom'); +const qrcode = require('qrcode'); +const path = require('path'); +const fs = require('fs'); const app = express(); app.use(express.json()); diff --git a/package.json b/package.json index 29299cb..6f3734e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "baileys-whatsapp-api", "version": "1.0.0", "description": "API WhatsApp multi-device avec Baileys", - "type": "module", "scripts": { "start": "node index.js" },