module.exports.config = { name: "taixiu1", version: "1.0.0", hasPermssion: 0, credits:…
- User
module.exports.config = { name: "taixiu1", version: "1.0.0", hasPermssion: 0, credits: "DungUwU", description: "taixiu nhiều người có ảnh", commandCategory: "game", usages: "[create/leave/start]\n[tài/xỉu]", cooldowns: 3 };
const axios = require('axios');
module.exports.languages = { "vi": { "missingInput": "Số Tiền Đặt Cược Không Phải Là Số Âm", "wrongInput": "Nhập liệu không hợp lệ?", "moneyBetNotEnough": "Số tiền bạn đặt lớn hơn hoặc bằng số dư của bạn!", "limitBet": "Số coin đặt không được dưới 50$!", "alreadyHave": "Đang có 1 ván tài xỉu diễn ra ở nhóm này!", "alreadyBet": "Bạn đã thay đổi mức cược là %1 đô vào %2.", "createSuccess": "===[ TAIXIU ]===\nTạo thành công, dùng:\nĐể tham gia đặt cược, dùng:\n%1%2 [tài/xỉu] tiền_cược\n(có thể đặt nhiều con cùng lúc)", "noGame": "====[ TAIXIU ]====\nNhóm của bạn không có ván tài xỉu nào đang diễn ra cả!", "betSuccess": "Đặt thành công %1 đô vào %2", "notJoined": "Bạn chưa tham gia tài xỉu ở nhóm này!", "outSuccess": "Đã rời ván tài xỉu thành công, bạn sẽ được hoàn tiền!", "shaking": "Đang lắc...", "final": "====[💎 KẾT QUẢ 💎]====", "notAuthor": "Bạn khồng phải chủ phòng.", "unknown": "Câu lệnh không hợp lệ, để xem cách dùng, sử dụng: %1help %2", "noPlayer": "Hiện không có người đặt cược", "info": "-o-TAIXIU-<-----------\nChủ phòng: %1\n-o--------<-----------\nNgười tham gia: \n%2" } }
const dice_images = [ "https://i.ibb.co/1JGMF5Q/row-1-column-1.jpg", "https://i.ibb.co/tq3nykP/row-1-column-2.jpg", "https://i.ibb.co/bP4d8tR/row-2-column-1.jpg", "https://i.ibb.co/GdhsNG7/row-2-column-2.jpg", "https://i.ibb.co/884GLkx/row-3-column-1.jpg", "https://i.ibb.co/2N86jZ1/row-3-column-2.jpg" ];
module.exports.run = async function({ api, event, args, getText, Users, Threads, Currencies }) { const request = require('request') const fs = require('fs') if (!fs.existsSync(__dirname + '/cache/abcde.png')) { request('https://i.imgur.com/iRCMI5V.png').pipe(fs.createWriteStream(__dirname + '/cache/abcde.png')); } if (!global.client.taixiu_ca) global.client.taixiu_ca = {};
//DEFINE SOME STUFF HERE.. const { senderID, messageID, threadID } = event; if (args.length == 0) { var abcd = { body: '==== 🎲 TÀI XỈU 🎲 ====\n» Create: Tạo Bàn Để Chơi Cùng Các Người Chơi Khác\n» Leave: Rời Khỏi Bàn Tài Xỉu\n» Start: Bắt Đầu Bàn Tài Xỉu\n» End: Kết Thúc Bàn Này.', attachment: [ fs.createReadStream(__dirname + "/cache/abcde.png") ] } return api.sendMessage(abcd, threadID, messageID) } const { increaseMoney, decreaseMoney, getData } = Currencies; const moneyUser = (await getData(senderID)).money; const sendC = (msg, callback) => api.sendMessage(msg, threadID, callback, messageID); const sendTC = async (msg, callback) => api.sendMessage(msg, threadID, callback); const sendT = (msg) => sendTC(msg, () => { }); const send = (msg) => sendC(msg, () => { }); const threadSetting = (await Threads.getData(String(event.threadID))).data || {}; const prefix = (threadSetting.hasOwnProperty("PREFIX")) ? threadSetting.PREFIX : global.config.PREFIX;
- Assistant
To convert the given code to ES module (ESM) format, you need to make some changes:
- Replace
module.exportswithexportkeyword. - Replace
requirestatements withimportstatements. - Update the file paths to follow ESM conventions.
Here's the updated code:
// Import necessary modules import axios from "axios"; import fs from "fs"; import request from "request"; import { createRequire } from "module"; const require = createRequire(import.meta.url); // Config object export const config = { name: "taixiu1", version: "1.0.0", hasPermssion: 0, credits: "DungUwU", description: "taixiu nhiều người có ảnh", commandCategory: "game", usages: "[create/leave/start]\n[tài/xỉu]", cooldowns: 3, }; // Language object export const languages = { vi: { // ... the rest of the language object }, }; // dice_images array const dice_images = [ "https://i.ibb.co/1JGMF5Q/row-1-column-1.jpg", "https://i.ibb.co/tq3nykP/row-1-column-2.jpg", "https://i.ibb.co/bP4d8tR/row-2-column-1.jpg", "https://i.ibb.co/GdhsNG7/row-2-column-2.jpg", "https://i.ibb.co/884GLkx/row-3-column-1.jpg", "https://i.ibb.co/2N86jZ1/row-3-column-2.jpg", ]; // Main run function export async function run({ api, event, args, getText, Users, Threads, Currencies }) { // ... the rest of the run function implementation } - Replace