Step 1: Create Your Bot on Telegram
- Go to @BotFather on Telegram.
- Send the command
/newbot
to create a new bot. - Follow the instructions to name your bot and create a username.
- Send Name of your bot.
- Now it will ask you to give username for your bot.
- Username should endswith "bot" text and unique.
- for example:
sidkacompiler12bot
.
You will receive a bot token and a bot link after completing these steps.
For termux
- Go to fdroid website and Download latest version of Termux.
- In termux Run these bellow written commands.
curl -O https://api.ignoux.in/iocompiler/termux.sh
chmod +x termux.sh
bash termux.sh
cd ~/compiler
node index.js
- Follow each instructions of said by installer.
- That's it your bot is running on termux. !Enjoy.
- It will show you in red color warning ignore it your bot is runnig now.
For Linux and Windows
Pre-requirements- Node.js installed on your system.
- Optional: Install additional languages like C/C++, Python, Java, etc.
-
Open PowerShell, Command Prompt, or your terminal.
-
Create and navigate to a new directory for your project:
mkdir compiler cd compiler
-
Initialize a new Node.js project and install IOCompiler:
npm init -y npm install iocompiler
-
Create an
index.js
file and paste the following code. Replaceprocess.env.BOT_TOKEN
with your bot token from BotFather, andprocess.env.TELEGRAM_ID
with your Telegram ID:const { compiler } = require('iocompiler'); // Specify allowed users; without this, all users can access your bot const { bot } = compiler(process.env.BOT_TOKEN, { allowed: [1791106582, process.env.TELEGRAM_ID], mode: "private" }); // modes: "private", "public", "docker-private", "api-mode" // Launching telegraf bot in polling mode bot.launch({ dropPendingUpdates: true });
For Developers for using this lib in those work:
let { compiler } = require('iocompiler');
let { Telegraf } = require("telegraf")
let bot = new Telegraf(process.env.BOT_TOKEN)
bot.on("message", (ctx, next) => {
ctx.reply("I Got your message processing...")
// Change incomming message for compilation
ctx.update.message.text = "/js console.log('lol')"
// Give update to next handler with updated text
next(ctx)
})
/*
* ttl: max time to execute code, default 60 seconds
* allowed: array of telegram ids of users who can execute code on it
*/
// allowed users id if you not give this then all users can use your bot
compiler(bot, { ttl: 60, allowed: [1791106582]});
// launching telegraf bot in polling mode
bot.launch({ dropPendingUpdates: true });
- Run the project:
node index.js
That's it! You have successfully created your Telegram bot using IOCompiler.
- See all commands:
/help
- Check if bot is running:
/ping
- See current version and features of the bot:
/version
For any queries, join our support groups:
GitHub: IOCompiler Repository
NPM: IOCompiler on NPM
For any other help:
- Support Group: LogicB Support
- Updates: Logicbots
- Bot Owner: @PanditSiddharth
Testing Group: IO_Coding
Contribute to the project or create your own bot—it's open source!
Using your bot, users can potentially harm your system. Utilize Docker or any secure environment, or specify allowed users via Telegram ID.