{"id":18291809,"url":"https://github.com/prantadas/telegrambot-scaffold","last_synced_at":"2025-04-09T07:52:27.066Z","repository":{"id":228073976,"uuid":"773087827","full_name":"PrantaDas/TelegramBot-Scaffold","owner":"PrantaDas","description":"A simple telegraf Bot boilerplate built on top of Telegraf.Js to make the way of making a bot simpler.","archived":false,"fork":false,"pushed_at":"2024-03-16T18:04:59.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T02:16:41.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrantaDas.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}},"created_at":"2024-03-16T17:59:00.000Z","updated_at":"2024-08-25T07:20:24.000Z","dependencies_parsed_at":"2024-03-17T01:07:03.573Z","dependency_job_id":null,"html_url":"https://github.com/PrantaDas/TelegramBot-Scaffold","commit_stats":null,"previous_names":["prantadas/telegrambot-scaffold"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2FTelegramBot-Scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2FTelegramBot-Scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2FTelegramBot-Scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2FTelegramBot-Scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrantaDas","download_url":"https://codeload.github.com/PrantaDas/TelegramBot-Scaffold/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999850,"owners_count":21031044,"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":[],"created_at":"2024-11-05T14:15:16.633Z","updated_at":"2025-04-09T07:52:27.024Z","avatar_url":"https://github.com/PrantaDas.png","language":"TypeScript","readme":"\u003ch1\u003eTelegram Bot Scaffold 🐳\u003c/h1\u003e\n\n```typescript\nA template for a telegram bot build on top of Telegraf.Js.\n.\n├── config\n|    ├── dev.env\n|    └── prod.env\n├── src\n|   ├── telegram\n|   |   ├── wizards\n|   |   |   ├── command.ts\n|   |   |   └── demo.wizard.ts\n|   |   ├── actions.ts\n|   |   ├── bot.ts\n|   |   ├── menu.ts\n|   |   ├── types.ts\n|   |   └── utils.ts\n|   └── index.ts\n|\n├── .gitignore\n├── Feedbacks.md\n├── License\n├── package.json\n├── README.md\n├── tsconfig.json\n└── yarn.lock\n\n```\n\nEnviroment Variables\n\n`BOT_TOKEN = 'your_bot_token'`\u003c/br\u003e\n`MODE = 'dev'`\n\n## Installation\n\nClone the project\n```shell\n$ git clone https://github.com/PrantaDas/TelegramBot-Scaffold.git\n```\nGo to the project directory\n\n```shell\n$ cd TelegramBot-Scaffold\n```\n\nInstall dependencies\n```shell\n$ yarn or npm install or pnpm install\n```\n\nStart the bot\n```shell\n$ yarn start-dev or npm run start-dev or pnpm start-dev\n```\n\nUsage/Examples:\n\n\n\nInclude all the markup menus that will appear on telegram\n```javascript\nexport default function (type?: string): InlineKeyboardMarkup {\n\n    // include all the availabe commands here before starting\n    const menu: UserCommand[] = [...defaultMenu];\n\n}\n```\n\n\nInclude the bot actions inside the `action` function.\n\n```javascript\nexport default function actions(bot: Telegraf\u003cMyContext\u003e, userData?: UserData) {\n    // include all the bot actions here\n    const botActions: Actions[] = [\n        {\n            action: 'sniperBot',\n            name: 'Buy or Sell',\n            sceneName: 'buy-sell',\n            enterScene: true,\n            callback: async () =\u003e console.log('entered the scene')\n        }\n    ];\n\n}\n```\n\nCreate custom scene\n\n```javascript\nimport { Scenes } from \"telegraf\";\nimport { message } from 'telegraf/filters';\nimport menu from \"../menu\";\n\nconst defaultWizard = new Scenes.WizardScene(\n    \"default-wizard\",\n    async (ctx) =\u003e {\n        await ctx.replyWithHTML(\n            '\u003cb\u003eAvailable Options\u003c/b\u003e', {\n            reply_markup: menu()\n        }\n        );\n    },\n    async (ctx) =\u003e {\n        console.log(ctx);\n        await ctx.scene.leave();\n    },\n);\n\ndefaultWizard.on(message('text'), async (ctx) =\u003e {\n    console.log(ctx);\n});\n\nexport default defaultWizard;\n```\n\nThen include the wizard to the state middleware\n\n```javascript\nconst stage = new Scenes.Stage\u003cMyContext\u003e([buyWizard,other_middleware]);\n```\n\n\nSet the bot commands in `bot.ts` file before starting\n\n```javascript\nconst myCommands: Command[] = [your_commands];\n\n// setting the bot commands\nbot.telegram.setMyCommands(myCommands);\n```\n\n\u003e Under Development  📝.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Ftelegrambot-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantadas%2Ftelegrambot-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Ftelegrambot-scaffold/lists"}