Merge branch 'master' of github.com:bukhalo/nestjs-telegraf into feature/v2

 Conflicts:
	package-lock.json
	package.json
This commit is contained in:
Alexander Bukhalo 2021-01-02 16:15:58 +03:00
commit 9f4e64baac
14 changed files with 25596 additions and 3752 deletions

View File

@ -1,64 +0,0 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "Sedjj",
"name": "Eldar Salimzebarov",
"avatar_url": "https://avatars3.githubusercontent.com/u/5383030?v=4",
"profile": "https://github.com/Sedjj",
"contributions": [
"bug"
]
},
{
"login": "lamuertepeluda",
"name": "Vito Macchia",
"avatar_url": "https://avatars3.githubusercontent.com/u/2249342?v=4",
"profile": "http://www.ismb.it/vito.macchia",
"contributions": [
"code",
"bug"
]
},
{
"login": "edgesite",
"name": "KITAHARA SETSUNA",
"avatar_url": "https://avatars3.githubusercontent.com/u/10336620?v=4",
"profile": "https://github.com/edgesite",
"contributions": [
"code",
"bug"
]
},
{
"login": "bukhalo",
"name": "Aleksandr Bukhalo",
"avatar_url": "https://avatars2.githubusercontent.com/u/14031838?v=4",
"profile": "https://bukhalo.com/",
"contributions": [
"code",
"doc",
"review"
]
},
{
"login": "VyacheslavSaloidWork",
"name": "Vyacheslav Saloid",
"avatar_url": "https://avatars3.githubusercontent.com/u/43011265?v=4",
"profile": "https://github.com/VyacheslavSaloidWork",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,
"projectName": "nestjs-telegraf",
"projectOwner": "bukhalo",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}

2
.github/FUNDING.yml vendored
View File

@ -1 +1 @@
custom: ["https://www.tinkoff.ru/sl/95M2htqoxux"] custom: ['https://www.tinkoff.ru/sl/95M2htqoxux']

View File

@ -1,11 +0,0 @@
version: 2
updates:
# Configuration for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "bukhalo"
assignees:
- "bukhalo"

View File

@ -12,12 +12,12 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [12.x, 13.x] node-version: [14.x, 15.x]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 uses: actions/setup-node@v2
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- run: npm ci - run: npm ci

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2019 - present Bukhalo Aleksandr Aleksandrovich Copyright (c) 2019 - present Alexander Bukhalo (a@bukhalo.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -71,40 +71,3 @@ export class AppService {
} }
} }
``` ```
## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## People
- Authors - [Aleksandr Bukhalo](https://bukhalo.com/) & [Igor Kamyshev](https://kamyshev.me/)
- Maintainers - [Aleksandr Bukhalo](https://bukhalo.com/)
- Website - [https://nestjs.com](https://nestjs.com/)
## License
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/Sedjj"><img src="https://avatars3.githubusercontent.com/u/5383030?v=4" width="100px;" alt=""/><br /><sub><b>Eldar Salimzebarov</b></sub></a><br /><a href="https://github.com/bukhalo/nestjs-telegraf/issues?q=author%3ASedjj" title="Bug reports">🐛</a></td>
<td align="center"><a href="http://www.ismb.it/vito.macchia"><img src="https://avatars3.githubusercontent.com/u/2249342?v=4" width="100px;" alt=""/><br /><sub><b>Vito Macchia</b></sub></a><br /><a href="https://github.com/bukhalo/nestjs-telegraf/commits?author=lamuertepeluda" title="Code">💻</a> <a href="https://github.com/bukhalo/nestjs-telegraf/issues?q=author%3Alamuertepeluda" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/edgesite"><img src="https://avatars3.githubusercontent.com/u/10336620?v=4" width="100px;" alt=""/><br /><sub><b>KITAHARA SETSUNA</b></sub></a><br /><a href="https://github.com/bukhalo/nestjs-telegraf/commits?author=edgesite" title="Code">💻</a> <a href="https://github.com/bukhalo/nestjs-telegraf/issues?q=author%3Aedgesite" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://bukhalo.com/"><img src="https://avatars2.githubusercontent.com/u/14031838?v=4" width="100px;" alt=""/><br /><sub><b>Aleksandr Bukhalo</b></sub></a><br /><a href="https://github.com/bukhalo/nestjs-telegraf/commits?author=bukhalo" title="Code">💻</a> <a href="https://github.com/bukhalo/nestjs-telegraf/commits?author=bukhalo" title="Documentation">📖</a> <a href="https://github.com/bukhalo/nestjs-telegraf/pulls?q=is%3Apr+reviewed-by%3Abukhalo" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/VyacheslavSaloidWork"><img src="https://avatars3.githubusercontent.com/u/43011265?v=4" width="100px;" alt=""/><br /><sub><b>Vyacheslav Saloid</b></sub></a><br /><a href="https://github.com/bukhalo/nestjs-telegraf/issues?q=author%3AVyacheslavSaloidWork" title="Bug reports">🐛</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

5175
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,9 @@
"url": "https://github.com/bukhalo/nestjs-telegraf/issues" "url": "https://github.com/bukhalo/nestjs-telegraf/issues"
}, },
"license": "MIT", "license": "MIT",
"author": "Aleksandr Bukhalo <a@bukhalo.com>", "author": "Alexander Bukhalo <a@bukhalo.com>",
"contributors": [ "contributors": [
"Aleksandr Bukhalo <a@bukhalo.com> (https://bukhalo.com/)", "Alexander Bukhalo <a@bukhalo.com> (https://bukhalo.com/)"
"Igor Kamyshev <igor@kamyshev.me> (https://kamyshev.me/)"
], ],
"repository": "git@github.com:bukhalo/nestjs-telegraf.git", "repository": "git@github.com:bukhalo/nestjs-telegraf.git",
"scripts": { "scripts": {
@ -30,28 +29,25 @@
"precommit": "lint-staged", "precommit": "lint-staged",
"prepublish:npm": "npm run build", "prepublish:npm": "npm run build",
"publish:npm": "npm publish --access public", "publish:npm": "npm publish --access public",
"test": "", "test": ""
"sample-app": "ts-node --transpile-only -r tsconfig-paths/register sample/main.ts"
}, },
"dependencies": { "dependencies": {
"telegraf": "^3.38.0" "telegraf": "^3.38.0"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/common": "7.6.1", "@nestjs/common": "7.6.5",
"@nestjs/core": "7.6.1", "@nestjs/core": "7.6.5",
"@typescript-eslint/eslint-plugin": "4.9.1", "@typescript-eslint/eslint-plugin": "4.11.1",
"@typescript-eslint/parser": "4.9.1", "@typescript-eslint/parser": "4.11.1",
"eslint": "7.15.0", "eslint": "7.17.0",
"eslint-config-prettier": "7.0.0", "eslint-config-prettier": "7.1.0",
"eslint-plugin-import": "2.22.1", "eslint-plugin-import": "2.22.1",
"husky": "4.3.5", "husky": "4.3.6",
"lint-staged": "10.5.3", "lint-staged": "10.5.3",
"prettier": "2.2.1", "prettier": "2.2.1",
"reflect-metadata": "0.1.13", "reflect-metadata": "0.1.13",
"rxjs": "6.6.3", "rxjs": "6.6.3",
"ts-node": "^9.1.1", "typescript": "4.1.3"
"tsconfig-paths": "^3.9.0",
"typescript": "4.1.2"
}, },
"peerDependencies": { "peerDependencies": {
"@nestjs/common": "^6.7.0 || ^7.0.0", "@nestjs/common": "^6.7.0 || ^7.0.0",

10
renovate.json Normal file
View File

@ -0,0 +1,10 @@
{
"semanticCommits": true,
"packageRules": [
{
"depTypeList": ["devDependencies"],
"automerge": true
}
],
"extends": ["config:base"]
}

View File

@ -0,0 +1,27 @@
---
id: standalone-applications
title: Standalone applications
sidebar_label: Standalone applications
slug: standalone-applications
---
If you initialized your application with the [Nest CLI](https://docs.nestjs.com/cli/overview), [Express](https://expressjs.com/) framework will be installed by default along with Nest. Nest and NestJS Telegraf does not require Express for work. So if you don't plan to getting bot updates through webhooks, and you don't need a web server, you can remove Express.
To do this, change the `bootstrap` function in the `main.ts` file of your project on something like that:
```typescript
async function bootstrap() {
const app = await NestFactory.createApplicationContext(AppModule);
}
bootstrap();
```
This initializes Nest as a **standalone application** (without any network listeners).
All that remains is to remove unused dependencies:
```bash
npm un @nestjs/platform-express @types/express
```
:::info
More information about standalone applications located at [Nest documentation](https://docs.nestjs.com/standalone-applications)
:::

View File

@ -1,10 +1,16 @@
--- ---
id: webhooks id: getting-updates
title: Webhooks title: Getting updates
sidebar_label: Webhooks sidebar_label: Getting updates
slug: webhooks slug: getting-updates
--- ---
## Long polling
By default, the bot receives updates using long-polling and requires no additional action.
## Webhooks
If you want to configure a telegram bot webhook, you need to get a middleware from `TelegrafProvider` for connect it in your `main.ts` file. If you want to configure a telegram bot webhook, you need to get a middleware from `TelegrafProvider` for connect it in your `main.ts` file.
To access it, you must use the `app.get()` method, followed by the provider reference: To access it, you must use the `app.get()` method, followed by the provider reference:

23947
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,12 +11,12 @@
"serve": "docusaurus serve" "serve": "docusaurus serve"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "2.0.0-alpha.63", "@docusaurus/core": "2.0.0-alpha.70",
"@docusaurus/preset-classic": "2.0.0-alpha.63", "@docusaurus/preset-classic": "2.0.0-alpha.70",
"@mdx-js/react": "^1.5.8", "@mdx-js/react": "1.6.22",
"clsx": "^1.1.1", "clsx": "1.1.1",
"react": "^16.8.4", "react": "17.0.1",
"react-dom": "^16.8.4" "react-dom": "17.0.1"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -31,11 +31,11 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-alpha.51", "@docusaurus/module-type-aliases": "2.0.0-alpha.f37987f32",
"@tsconfig/docusaurus": "^1.0.2", "@tsconfig/docusaurus": "1.0.2",
"@types/react": "^16.9.49", "@types/react": "17.0.0",
"@types/react-helmet": "^6.1.0", "@types/react-helmet": "6.1.0",
"@types/react-router-dom": "^5.1.5", "@types/react-router-dom": "5.1.7",
"typescript": "^4.0.2" "typescript": "4.1.3"
} }
} }

View File

@ -2,11 +2,12 @@ module.exports = {
docs: { docs: {
'Getting Started': [ 'Getting Started': [
'installation', 'installation',
'getting-updates',
'telegraf-methods', 'telegraf-methods',
'bot-injection', 'bot-injection',
'async-configuration', 'async-configuration',
'webhooks',
], ],
Extras: ['extras/standalone-applications'],
'API Reference': ['api-reference/decorators'], 'API Reference': ['api-reference/decorators'],
}, },
}; };