A fun and engaging messenger bot for SimSim talk and entertainment, built with Node.js.
NexaSim V2 is a messenger bot designed for fun and SimSim talk, allowing users to engage in entertaining conversations and perform various tasks like downloading videos, generating images, and interacting with AI. I created this bot to bring joy and utility to messenger group chats, making conversations more interactive and enjoyable for everyone.
NexaSim V2 is built using Node.js and integrates with the Facebook Messenger API. It listens for messages, processes commands, and responds accordingly. Here's a simple overview of how it works:
-
User sends a message with a command prefix (e.g.,
.help
). -
Bot processes the command by matching it with registered commands.
-
Bot executes the command logic (e.g., API calls, file downloads, or text responses).
-
Bot sends a response back to the user with the result.
// Example command: .hello
module.exports = {
name: "hello",
description: "Says hello to the user",
async execute({ api, event }) {
api.sendMessage("Hello! How can I help you today?", event.threadID);
}
};
To set up the database for NexaSim V2, follow these steps:
- Navigate to the
includes/database/
directory in the repository. - Locate the file
example.index.js
and rename it toindex.js
. - Open
index.js
and find the MongoDB URI placeholder. - Replace the placeholder with your actual MongoDB URI (e.g.,
mongodb://your-username:your-password@your-host:27017/your-database
). - Save the file.
Your bot will now connect to your MongoDB database for storing user data, economy balances, or other features requiring persistence.
NexaSim V2 allows you to create various types of commands. Below are examples of a simple command, an admin command, and an economy command.
A basic command that anyone can use.
const config = require('../../config/config.json');
module.exports = {
name: "uid",
version: "1.0.0",
author: "Hridoy",
description: "Shows the UID of the user, a mentioned user, or the replied-to user.",
adminOnly: false,
commandCategory: "utility",
guide: "Use {pn}uid to get your UID, {pn}uid @username to get a mentioned user's UID, or reply to a message with {pn}uid to get that user's UID.",
cooldowns: 5,
usePrefix: true,
async execute({ api, event, args }) {
if (!event || !event.threadID || !event.messageID) {
console.error("Invalid event object in uid command");
return api.sendMessage(`${config.bot.botName}: ❌ Invalid event data.`, event.threadID);
}
let targetUid;
let targetName = "User";
try {
if (event.type === "message_reply" && event.messageReply) {
targetUid = event.messageReply.senderID;
const userInfo = await new Promise((resolve) => {
api.getUserInfo(targetUid, (err, info) => resolve(err ? {} : info));
});
targetName = userInfo[targetUid]?.name || "Replied User";
}
else if (event.mentions && Object.keys(event.mentions).length > 0) {
const mentionedUsers = Object.keys(event.mentions);
if (mentionedUsers.length > 1) {
return api.sendMessage(`${config.bot.botName}: Please mention only one user.`, event.threadID, event.messageID);
}
targetUid = mentionedUsers[0];
targetName = event.mentions[targetUid] || "Mentioned User";
}
else {
targetUid = event.senderID;
const userInfo = await new Promise((resolve) => {
api.getUserInfo(targetUid, (err, info) => resolve(err ? {} : info));
});
targetName = userInfo[targetUid]?.name || "You";
}
await api.sendMessage(
`${config.bot.botName}: ${targetName}'s UID: ${targetUid}`,
event.threadID,
event.messageID
);
} catch (error) {
console.error("❌ Error in uid command:", error);
await api.sendMessage(
`${config.bot.botName}: ❌ Failed to retrieve UID.`,
event.threadID,
event.messageID
);
}
}
};
A command restricted to admins, useful for moderation.
const config = require('../../config/config.json');
module.exports = {
name: "uid",
version: "1.0.0",
author: "Hridoy",
description: "Shows the UID of the user, a mentioned user, or the replied-to user.",
adminOnly: true,
commandCategory: "utility",
guide: "Use {pn}uid to get your UID, {pn}uid @username to get a mentioned user's UID, or reply to a message with {pn}uid to get that user's UID.",
cooldowns: 5,
usePrefix: true,
async execute({ api, event, args }) {
....
A command for managing a virtual economy, like a balance system.
const config = require('../../config/config.json');
const { connect } = require('../../includes/database');
const logger = require('../../includes/logger');
module.exports = {
name: "work",
version: "1.0.0",
author: "Hridoy",
description: "Earn a random amount of currency (15/20/25) once every 24 hours.",
adminOnly: false,
commandCategory: "economy",
guide: "Use {pn}work to earn currency once every 24 hours.",
cooldowns: 0,
usePrefix: true,
async execute({ api, event, args }) {
if (!event || !event.threadID || !event.messageID) {
console.error("Invalid event object in work command");
return api.sendMessage(`${config.bot.botName}: ❌ Invalid event data.`, event.threadID);
}
const db = await connect();
const usersCollection = db.collection('users');
const user = await usersCollection.findOne({ userId: event.senderID });
if (!user) {
return api.sendMessage(`${config.bot.botName}: ⚠️ User not found in database.`, event.threadID);
}
const now = Date.now();
const lastWork = user.lastWork || 0;
const cooldown = 24 * 60 * 60 * 1000;
if (now - lastWork < cooldown) {
const timeLeft = Math.ceil((cooldown - (now - lastWork)) / (60 * 60 * 1000));
return api.sendMessage(`${config.bot.botName}: ⚠️ You can only work once every 24 hours. Try again in ${timeLeft} hours.`, event.threadID);
}
const amounts = [15, 20, 25];
const earnedAmount = amounts[Math.floor(Math.random() * amounts.length)];
const newBalance = (user.balance || 0) + earnedAmount;
await usersCollection.updateOne(
{ userId: event.senderID },
{ $set: { balance: newBalance, lastWork: now } }
);
logger.info(`User ${event.senderID} worked and earned ${earnedAmount}. New balance: ${newBalance}`);
api.sendMessage(`${config.bot.botName}: ✅ You worked and earned ${earnedAmount}! Your new balance is ${newBalance}.`, event.threadID);
}
};
Here are some screenshots of NexaSim V2 in action:
Using the .help
command to list available commands.
Chat with NexaSim .bot
. Also you can play a game .hangman
.
A advance example canvas and api command .gitcard
command.
For support or to connect with the community, reach out via:
-
Telegram: Join our Telegram
-
Facebook: My facebook
-
Instagram: My instagram
-
GitHub: Visit the Repository
-
Codebase: Written in Node.js, leveraging the
axios
library for API requests andfs
for file handling. -
Features: Includes video downloading (YouTube, Instagram, Facebook), AI interactions (GPT-4), image generation, and more.
-
Performance: Optimized for low-latency responses, with a modular command structure for easy expansion.
-
Dependencies: Requires Node.js v20 and dependencies listed in
package.json
.
© 2025 Hridoy (1dev-hridoy). All rights reserved.
This project is licensed under the MIT License - see the LICENSE file for details.