A simple and lightweight Telegram bot base built with Telegraf library. Easy to use with minimal resource consumption.
- π Simple and clean code structure
- πΎ Low resource usage
- π§ Easy to customize and extend
- β‘ Fast and responsive
- π¦ Built with Telegraf library
- Node.js v18 or newer
- npm or yarn
- Telegram Bot Token from @BotFather
- CPU: 50% (1 core)
- RAM: 1GB
- Disk Space: 1GB
- Clone the repository
git clone https://github.com/herzonly/DHX.git
cd DHX- Install dependencies
npm install- Configure the bot
# Edit config.js and fill in your bot configuration
nano config.js- Fill in the configuration in
config.js
global.TOKEN = "YOUR_BOT_TOKEN_HERE"
global.wm = "β’ Dash X API"
global.wait = "__**Wait a minute...**__"
// Required, register at https://api.dashx.dpdns.org
global.dhx = "YOUR_DHX_API_KEY"
global.owner = ["YOUR_TELEGRAM_ID"]
global.mods = []
global.prems = []
global.prefix = /^[.,!/#]/
global.botName = "DashX Bot"
global.ownerName = "Owner"
global.wm = "DHX"
global.sig = "https://instagram.com/notme_botz"
global.thumb = "https://telegra.ph/file/a8e9f9edf366707fbadf1.jpg"
global.multiplier = 69
global.APIs = {
api1: 'https://api.example.com'
}
global.APIKeys = {
'https://api.example.com': 'your-api-key'
}
global.opts = {
self: false,
restrict: false,
test: false,
tmp: false
}
global.myfile = Buffer.from("aGVsbG8=", "base64")
global.minety = "application/pdf"Start the bot:
npm startFor development with auto-reload:
npm run devDHX/
βββ plugins/ # Bot command handlers
βββ handler.js # Event handlers
βββ lib/ # Utility functions
βββ config.js # Configuration file
βββ index.js # Main entry point
βββ package.json
Create a new file in the plugins/ directory:
let handler = async (m, { bot }) => {
const username = m.from.first_name || 'User'
const botname = bot.botInfo?.first_name || 'Bot'
let txt = `π Hi *${username}*! My name is *${botname}*\n\n`
txt += `Welcome to my service! I'm here to assist you with various features and commands. `
txt += `I'm designed to make your experience smooth and enjoyable while providing you with useful tools and information.\n\n`
txt += `π€ *About Me*\n`
txt += `I am an advanced automated assistant built to help you with multiple tasks. `
txt += `Whether you need information, entertainment, or just someone to chat with, I'm always ready to serve you 24/7.\n\n`
txt += `β¨ *What I Can Do*\n`
txt += `β’ Provide quick responses to your queries\n`
txt += `β’ Execute various commands and features\n`
txt += `β’ Deliver accurate information\n`
txt += `β’ Assist you with daily tasks\n`
txt += `β’ And much more!\n\n`
txt += `π *Getting Started*\n`
txt += `To see all available commands and features, simply type /help or /menu. `
txt += `You can explore different categories and discover what I can do for you. `
txt += `Don't hesitate to try out different commands!\n\n`
txt += `π‘ *Tips*\n`
txt += `β’ All commands start with / (slash)\n`
txt += `β’ Type /ping to check my response speed\n`
txt += `β’ Use /info to learn more about me\n`
txt += `β’ Feel free to ask questions anytime\n\n`
txt += `π Thank you for using my service! I hope you have a great experience. `
txt += `If you encounter any issues or have suggestions, please don't hesitate to reach out to my developer.\n\n`
txt += `Let's get started on this amazing journey together! π`
await m.reply(txt, { parse_mode: 'Markdown' })
}
handler.help = ['start']
handler.tags = ['main']
handler.command = /^(start)$/i
module.exports = handlerhandler.help- Array of command names shown in help menuhandler.tags- Command categoryhandler.command- Regex pattern for command trigger
TOKEN- Your Telegram bot token from BotFatherdhx- DashX API key (register at https://api.dashx.dpdns.org)owner- Array of owner Telegram IDsmods- Array of moderator Telegram IDsprems- Array of premium user Telegram IDsprefix- Command prefix regex patternbotName- Your bot's display nameAPIs- External API endpointsAPIKeys- API authentication keys
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is licensed under the CCZ LICENSE
Created by herzonly
If you find this project helpful, please give it a star!
If you'd like to support the development of this project, you can donate through:
Your support is greatly appreciated! π
Made with
Herza NGT