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
If your bot only supports esm, you will need to convert your CommonJS module to an ECMAScript module. Here's the converted code:
import axios from 'axios'; import fs from 'fs'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); 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 }; const languages = { "vi": { // Add your translations here } }; 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" ]; async function run(options) { const { api, event, args, getText, Users, Threads, Currencies } = options; if (args.length == 0) { // Add your code here } // Add the rest of your code here } function getConfig() { return config; } function getLanguages() { return languages; } export default { config: getConfig, languages: getLanguages, run }; - User
show me the full modified code
- Assistant
Here's the full modified code for your Facebook Messenger Chatbot in ECMAScript module format: