AoiTelegram

aoitelegram is a JavaScript/TypeScript library for creating Telegram bots with ease. It simplifies the process of building and managing Telegram bot functionality, similar to aoijs but tailored for Telegram.
Features
-
Over 200 Pre-built Functions: aoitelegram comes equipped with more than 200 pre-built functions, empowering you to effortlessly create dynamic and interactive Telegram bots.
-
Built-in Custom Function System: aoitelegram has very good support for custom functions. Besides, aoitelegram has classes for working with extensions that you can create.
-
CommonJS/ESM Support: aoitelegram now supports modules like CommonJS/ESM for more convenient development on NodeJS.
-
User-Friendly Design: aoitelegram is perfect for beginners with its straightforward function interface. The $ prefix simplifies command writing, ensuring a swift launch for your bot. đ
Starting from v1, aoitelegram has an improved parser/interpreter that ensures proper functioning of $if/$else/$endif similar to bdfd.
Installation
To use aoitelegram in your project, you can install it via npm:
npm install aoitelegram
Usage
Here's a quick example of how to use aoitelegram to create a Telegram bot:
const { AoiClient, LoadCommands } = require("aoitelegram");
import { AoiClient, LoadCommands } from "aoitelegram";
const bot = new AoiClient("YOUR_BOT_TOKEN_HERE", {
telegram?: RequestInit;
disableFunctions?: string[],
extension?: AoiExtension[],
functionError?: boolean,
sendMessageError?: boolean,
logging?: boolean,
myCommands?: {
register?: boolean,
scope?: BotCommandScope,
language_code?: string,
},
autoUpdate?: {
aoiWarning?: boolean,
autoUpdate?: boolean,
enableDev?: boolean,
enableBeta?: boolean,
},
});
bot.addEvent(["onReady", "onMessage", "onCallbackQuery", "onFunctionError"]);
bot.functionErrorCommand({
code: `$sendMessage[Sorry, but there was an error in the $handleError[function] function within the $handleError[command] command: $handleError[error]]`,
});
bot.readyCommand({
code: `$print[Starting @$getMe[username]]`,
});
bot.messageCommand({
code: `$print[Message Handle]`,
});
bot.callbackQueryCommand({
code: `$print[Action Handle]`,
});
bot.addCommand({
command: "say",
code: `$replyMessage[$eventData[text]]`,
});
bot.addCommand({
command: "ping",
code: `$replyMessage[Bot ping: $pingms]`,
});
bot.addCommand({
command: "botinfo",
code: `
$replyMessage[
Bot ID: $getMe[id]
Name: $getMe[first_name]
Username: $getMe[username]
Ping: $pingms
]`,
});
const loader = new LoadCommands(bot);
loader.loadCommands("./command/");
bot.connect();
Documentation
For detailed documentation and usage instructions, please refer to the aoitelegram Wiki.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please create a GitHub issue or submit a pull request. Additionally, feel free to reach out to me on Telegram via my group AoiTelegram or on Discord using my username sempaika_chess.