rubika-bot-x
v1.0.4
Published
Node.js library for Rubika Bot API
Downloads
3
Maintainers
Readme
Rubika Bot
Node.js library for interacting with Rubika Bot API
Installation
npm install rubika-bot-xUsage
const { RubikaBot } = require('rubika-bot-x');
const bot = new RubikaBot('YOUR_BOT_TOKEN');
// Simple command handling
bot.when('/start', async (message) => {
await bot.sendMessage(message.chat_id, 'Welcome to Rubika Bot!');
});
bot.when('سلام', async (message) => {
await bot.sendMessage(message.chat_id, 'سلام! چطور میتونم کمکتون کنم؟');
});
// Start the bot
bot.start();API Reference
RubikaBot
Constructor
new RubikaBot(token, options)Methods
sendMessage(chat_id, text, options)sendMessageWithInlineKeyboard(chat_id, text, keyboard, options)sendPoll(chat_id, question, options)sendLocation(chat_id, latitude, longitude, options)getMe()getChat(chat_id)when(pattern, handler)- Register message handlerstart()- Start polling
Examples
See the examples directory for more usage examples.
License
MIT
