{"id":29281251,"url":"https://github.com/degreet/nestgram","last_synced_at":"2025-07-05T16:43:48.411Z","repository":{"id":37699590,"uuid":"498460762","full_name":"Degreet/nestgram","owner":"Degreet","description":"Framework for working with Telegram Bot API on TypeScript like Nest.js","archived":false,"fork":false,"pushed_at":"2024-06-10T20:04:44.000Z","size":250,"stargazers_count":26,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T13:11:02.006Z","etag":null,"topics":["bot","nest","nestgram","nestjs","telegram","telegram-bot","telegram-bot-api","typescript"],"latest_commit_sha":null,"homepage":"https://degreetpro.gitbook.io/nestgram/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Degreet.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-05-31T18:54:27.000Z","updated_at":"2024-08-24T21:52:11.000Z","dependencies_parsed_at":"2024-06-21T13:06:25.229Z","dependency_job_id":"0e339380-0fd0-4c0b-8de6-54f6337e6072","html_url":"https://github.com/Degreet/nestgram","commit_stats":{"total_commits":164,"total_committers":1,"mean_commits":164.0,"dds":0.0,"last_synced_commit":"1707a911a7f2774901fabfcb7a2fe058cf949b2a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Degreet/nestgram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Degreet%2Fnestgram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Degreet%2Fnestgram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Degreet%2Fnestgram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Degreet%2Fnestgram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Degreet","download_url":"https://codeload.github.com/Degreet/nestgram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Degreet%2Fnestgram/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263773663,"owners_count":23509253,"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","nest","nestgram","nestjs","telegram","telegram-bot","telegram-bot-api","typescript"],"created_at":"2025-07-05T16:43:46.382Z","updated_at":"2025-07-05T16:43:48.403Z","avatar_url":"https://github.com/Degreet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is Nestgram?\n\nNestgram - Framework for working with Telegram Bot API on TypeScript like Nest.js\n\n\u003e ℹ️ Nestgram in development. Current version is **1.8.7** \u003cbr\u003e\n\u003e If you found a bug, you can ask the [author](https://t.me/degreet) or ask the [form](https://do67hlsz91r.typeform.com/to/sI6NXBKV)\n\n\u003e ⚠️ Nestgram can't use Nest.js modules. But you can create own modules for Nestgram :)\n\n# Links\n\n- [Official website](https://degreetpro.gitbook.io/nestgram/)\n- [GitHub](https://github.com/Degreet/nestgram)\n- [Author](https://t.me/degreet)\n- Our telegram channels:\n  - 🇺🇦 [Channel](https://t.me/nestgram_ts)\n  - 🇺🇸 [Channel](https://t.me/nestgram_en)\n\n# Guide\n\nYou can read the [guide on the official Nestgram website](https://degreetpro.gitbook.io/nestgram/getting-started/guide), on [Medium website](https://medium.com/p/ff251fb825fd) or here\n\n## Install Nestgram\n\nYou need to install nestgram at first. You can do this using yarn or npm\n\n```nginx\nyarn add nestgram\n// or\nnpm i nestgram\n```\n\n## Create main file\n\nOur next step is creating the main file, so let's create the `main.ts` file\n\n```typescript\nimport { NestGram } from 'nestgram';\nimport { AppModule } from './app/app.module';\n\nasync function bootstrap(): Promise\u003cvoid\u003e {\n  const bot = new NestGram('TOKEN', AppModule);\n  await bot.start();\n}\n\nbootstrap();\n```\n\nAt first, we imported nestgram and our `AppModule`, later we will create it. In the next step, we created a bootstrap function, in which we set up and run the project. The `NestGram` class takes arguments:\n\n| Argument | Name                                                                                                                                      | Required     |\n|:---------|:------------------------------------------------------------------------------------------------------------------------------------------|:-------------|\n| 1        | Bot token. You can get it [here](https://t.me/BotFather)                                                                                  | **Required** |\n| 2        | [App module](#create-app.module.ts)                                                                                                       | **Required** |\n| 3        | Config [IPollingConfig](https://core.telegram.org/bots/api#getupdates) or [IWebhookConfig](https://core.telegram.org/bots/api#setwebhook) | Optional     |\n| 4        | [Run config](https://degreetpro.gitbook.io/nestgram/config/webhooks-and-run-config#run-config)                                            | Optional     |\n\n## Create app.module.ts\n\nLet's create the `app.module.ts` file. In it, we will describe all available controllers and services\n\n```typescript\nimport { Module } from 'nestgram';\nimport { AppController } from './app.controller';\nimport { AppService } from './app.service';\n\n@Module({\n  controllers: [AppController],\n  services: [AppService],\n})\nexport class AppModule {}\n```\n\nAt first, we imported Module class from nestgram, `AppController` and `AppService` also, that we will create later. Then we described our controllers and services in `@Module` decorator\n\n## Create app.controller.ts\n\nLet's create the `app.controller.ts` file. In it, we will describe updates, that we want to handle\n\n```typescript\nimport { OnCommand, Controller } from 'nestgram';\nimport { AppService } from './app.service';\n\n@Controller()\nexport class AppController {\n  constructor(private readonly appService?: AppService) {}\n\n  @OnCommand('start')\n  start(): string {\n    return 'Hello, world!';\n  }\n}\n```\n\nWe have created a controller where we describe an update when the user writes `/start`, and we handle it by sending a message `Hello, world!`\n\n## Create app.service.ts\n\nLet's create the `app.service.ts` file. In it, we will describe methods with working with db, that we will call in controller\n\n```typescript\nimport { Service } from 'nestgram';\n\n@Service()\nexport class AppService {}\n```\n\nWe can describe methods in `AppService` class, and call it in controller by `this.appService`\n\n## Run project\n\nTo run the project, open a terminal in the project directory and type:\n\n```nginx\nnpm run dev\n```\n\nOr build and run production:\n\n```nginx\nnpm run build \u0026\u0026 npm run prod\n```\n\n# What’s next?\n\nNow you know about the syntax and structure of the Nestgram project, but if you want to write your own pro bot, you can check out the [Nestgram documentation](https://degreetpro.gitbook.io/nestgram/)\n\n# Found a bug?\n\nYou can ask the [author](https://t.me/degreet) or ask the [form](https://do67hlsz91r.typeform.com/to/sI6NXBKV?typeform-source=admin.typeform.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegreet%2Fnestgram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdegreet%2Fnestgram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegreet%2Fnestgram/lists"}