{"id":24794873,"url":"https://github.com/sobhan-srza/telegram-robot-handler","last_synced_at":"2026-04-11T06:05:22.859Z","repository":{"id":274097005,"uuid":"921718017","full_name":"Sobhan-SRZA/Telegram-RoBot-Handler","owner":"Sobhan-SRZA","description":"Make telegram robot with telegraf.js and my custom handlers.","archived":false,"fork":false,"pushed_at":"2025-02-08T21:52:02.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"0.0.2","last_synced_at":"2025-02-08T22:27:33.481Z","etag":null,"topics":["bot","handler","javascript","mr-sinre","nodejs","npm","persian-caesar","sobhan-srza","telegraf","telegraf-bots","telegraf-framework","telegraf-js","telegrafjs","telegram","telegram-api","telegram-bot","telegram-bot-api","telegram-userbot","telegrambot","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sobhan-SRZA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T13:37:59.000Z","updated_at":"2025-02-08T21:51:17.000Z","dependencies_parsed_at":"2025-01-26T07:25:27.332Z","dependency_job_id":null,"html_url":"https://github.com/Sobhan-SRZA/Telegram-RoBot-Handler","commit_stats":null,"previous_names":["sobhan-srza/telegram-robot","sobhan-srza/telegram-robot-handler"],"tags_count":3,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sobhan-SRZA%2FTelegram-RoBot-Handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sobhan-SRZA%2FTelegram-RoBot-Handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sobhan-SRZA%2FTelegram-RoBot-Handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sobhan-SRZA%2FTelegram-RoBot-Handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sobhan-SRZA","download_url":"https://codeload.github.com/Sobhan-SRZA/Telegram-RoBot-Handler/tar.gz/refs/heads/0.0.2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245330096,"owners_count":20597718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","handler","javascript","mr-sinre","nodejs","npm","persian-caesar","sobhan-srza","telegraf","telegraf-bots","telegraf-framework","telegraf-js","telegrafjs","telegram","telegram-api","telegram-bot","telegram-bot-api","telegram-userbot","telegrambot","typescript"],"created_at":"2025-01-29T23:18:35.589Z","updated_at":"2025-12-30T23:27:02.777Z","avatar_url":"https://github.com/Sobhan-SRZA.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 Telegram Bot Handler - Telegraf.js Framework \n\n**A High-Performance Telegram Bot Framework**  \n✨ Modern Architecture | 🚀 Optimized Performance | 🧩 Modular Design  \n\n![License](https://img.shields.io/badge/License-BSD--3--Clause-blue)\n![Telegraf Version](https://img.shields.io/badge/Telegraf-4.16.3-green)\n![Node.js](https://img.shields.io/badge/Node.js-18%2B-orange)\n![TypeScript](https://img.shields.io/badge/TypeScript-5.5.4-blue)\n\n## 🌟 Key Features\n- 🛡️ Advanced Anti-Crash System\n- 💾 Multi-Database Support (JSON/MySQL/MongoDB)\n- ⚡ Modern Command Handler with Cooldown\n- 📝 Colorful Console Logging\n- 🔄 Native TypeScript Support\n- 🤖 Full Telegram Bot API Coverage\n\n## 📦 Core Dependencies\n\n| Package      | Version | Purpose                |\n| ------------ | ------- | ---------------------- |\n| `telegraf`   | 4.16.3  | Telegram Bot Framework |\n| `quick.db`   | 9.1.7   | Database Management    |\n| `dotenv`     | 16.4.7  | Environment Variables  |\n| `colors`     | 1.4.0   | Console Coloring       |\n| `typescript` | 5.5.4   | TypeScript Compiler    |\n\n## 🚀 Quick Start\n\n1. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n2. **Configure environment**:\n   - Copy `example.env` to `.env`\n   ```env\n   token=\"YOUR_TELEGRAM_BOT_TOKEN\"\n   database_type=\"json\"\n   ```\n\n3. **Build \u0026 Run**:\n   ```bash\n   npm start\n   ```\n   \n   Or you can use this:\n   ```bash\n   npm run dev\n   ```\n\n   Then:\n   ```bash\n   node .\n   ```\n\n## ⌨️ Creating Commands\n\n1. Create new file in `src/commands/` (e.g.: `ping.ts`)\n2. Use this template:\n\n```typescript\nimport CommandType from \"../types/command\";\n\nconst command: CommandType = {\n  data: {\n    name: \"ping\",\n    description: \"Check bot latency\"\n  },\n  category: \"misc\",\n  cooldown: 3,\n  run: async (client, ctx) =\u003e {\n    await ctx.reply(\"🏓 Pong!\");\n  }\n};\n\nexport default command;\n```\n\n## 🎭 Creating Events\n\n1. Create new file in `src/events/` (e.g.: `messages.ts`)\n2. Use this template:\n\n```typescript\nimport { NarrowedContext } from \"telegraf\";\nimport { Message, Update } from \"telegraf/typings/core/types/typegram\";\nimport { MyContext } from \"../types/MessageContext\";\n\nconst event: EventType = {\n  name: \"message\",\n  run: async (client, message: NarrowedContext\u003cMyContext, Update.MessageUpdate\u003cMessage\u003e\u003e) =\u003e {\n    console.log(`New message from @${ctx.from?.username}`);\n  }\n};\n\nexport default event;\n```\n\n## 📂 Project Structure\n```\ntelegram-bot-handler/\n├── dist/            # Compiled JS\n├── src/\n│   ├── commands/    # Command handlers\n│   ├── handlers/    # Event handlers\n│   ├── classes/     # Core classes\n│   ├── functions/   # Functions\n│   ├── utils/       # Utilities\n│   └── types/       # TypeScript types\n├── .env             # Environment variables\n├── config.ts        # Main configuration\n└── package.json     # Dependencies\n```\n\n## ⚙️ Configuration Options\nCreate a `.env` file in the root directory. **Make sure to provide values for at least `token` and `database_type`.**  \nBelow is an example configuration:\n\n```ini\n# Bot token (required)\ntoken=\"YOUR_TELEGRAM_BOT_TOKEN\"\n\n# Database type (required): options are \"mysql\" | \"sql\" | \"mongodb\" | \"json\"\ndatabase_type=\"json\"\n\n# (Optional) If using MongoDB:\ndatabase_mongoURL=\"your-mongo-url\"\n\n# (Optional) If using MySQL:\ndatabase_msql_host=\"your-mysql-host\"\ndatabase_msql_user=\"your-mysql-user\"\ndatabase_msql_password=\"your-mysql-password\"\ndatabase_msql_database=\"your-mysql-database\"\n\n# Support server invite link (optional)\nsupport_url=\"https://discord.gg/yourInvite\"\n\n# Source owners (optional, comma-separated list of owner IDs)\nowners='[\"123456789\", \"987654321\"]'\n\n# Anti crash controller (optional)\nanti_crash=\"true\"\n\n# Send console errors to Discord (optional)\nlogger=\"true\"\n```\n\n## 📜 License\nThis project is licensed under the [BSD 3-Clause License](./license).\n\n```\nCopyright (c) 2024 Sobhan-SRZA \u0026 Persian Caesar\nAll rights reserved.\n```\n\n## 👥 Maintainers\n- [Sobhan-SRZA](https://github.com/Sobhan-SRZA) 🧑💻\n- [Persian Caesar](https://github.com/Persian-Caesar) 👑\n\n🌟 Contributions are welcome! Please open an issue or PR for suggestions.\n\n---\n\n**Need Help?**  \nJoin our support server: [Persian Caesar Discord](https://dsc.gg/persian-caesar)\n\nThis version includes:\n1. Clear visual hierarchy with emojis\n2. Version badges for key components\n3. Step-by-step setup guide\n4. Code examples for commands/events\n5. Configuration reference\n6. Project structure visualization\n7. License and contribution guidelines\n\n---\n\n## Contact\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://srza.ir\" target=\"_blank\"\u003e\n   \u003cimg align=\"left\" src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/social.png\" alt=\"Sobhan-SRZA social\" width=400px\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://t.me/d_opa_mine\" target=\"_blank\"\u003e\n   \u003cimg alt=\"Telegram\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/telegram-ch.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://t.me/Sobhan_SRZA\" target=\"_blank\"\u003e\n   \u003cimg alt=\"Telegram\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/telegram-ac.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.instagram.com/mr.sinre?igsh=cWk1aHdhaGRnOGg%3D\u0026utm_source=qr\" target=\"_blank\"\u003e\n   \u003cimg alt=\"Instagram\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/instagram.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.twitch.tv/sobhan_srza\" target=\"_blank\"\u003e\n   \u003cimg alt=\"Twitch\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/twitch.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.youtube.com/@mr_sinre?app=desktop\u0026sub_confirmation=1\" target=\"_blank\"\u003e\n   \u003cimg alt=\"YouTube\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/youtube.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://github.com/Sobhan-SRZA\" target=\"_blank\"\u003e\n   \u003cimg alt=\"Github\"\n    src=\"https://raw.githubusercontent.com/Sobhan-SRZA/Sobhan-SRZA/refs/heads/main/images/github.svg\"\n    height=\"30\" /\u003e\n  \u003c/a\u003e\n  \n  \u003cp align=\"left\"\u003e\n   \u003ca href=\"https://discord.gg/xh2S2h67UW\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://discord.com/api/guilds/1054814674979409940/widget.png?style=banner2\" alt=\"pc-development.png\"\u003e\n   \u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"right\"\u003e\n   \u003ca href=\"https://discord.gg/54zDNTAymF\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://discord.com/api/guilds/1181764925874507836/widget.png?style=banner2\" alt=\"pc-club.png\"\u003e\n   \u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://discord.com/users/865630940361785345\" target=\"_blank\"\u003e\n    \u003cimg alt=\"My Discord Account\" src=\"https://discord.c99.nl/widget/theme-1/865630940361785345.png\" /\u003e\n   \u003c/a\u003e\n    \u003ca href=\"https://discord.com/users/986314682547716117\" target=\"_blank\" align=\"right\"\u003e\n    \u003cimg alt=\"Team Discord Account\" src=\"https://discord.c99.nl/widget/theme-1/986314682547716117.png\" /\u003e\n   \u003c/a\u003e\n  \u003c/div\u003e\n\n \u003c/div\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobhan-srza%2Ftelegram-robot-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsobhan-srza%2Ftelegram-robot-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobhan-srza%2Ftelegram-robot-handler/lists"}