https://github.com/endykaufman/kaufman-bot
Simple bot for telegram
https://github.com/endykaufman/kaufman-bot
custom-injector nestjs telegram telegram-bot
Last synced: 8 months ago
JSON representation
Simple bot for telegram
- Host: GitHub
- URL: https://github.com/endykaufman/kaufman-bot
- Owner: EndyKaufman
- Created: 2017-08-08T17:15:55.000Z (almost 9 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-02T07:26:09.000Z (over 3 years ago)
- Last Synced: 2025-02-05T11:12:15.471Z (over 1 year ago)
- Topics: custom-injector, nestjs, telegram, telegram-bot
- Language: TypeScript
- Homepage: https://telegram.me/KaufmanBot
- Size: 3.13 MB
- Stars: 26
- Watchers: 2
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# KaufmanBot
Simple bot for telegram
[![NPM version][npm-image]][npm-url] [![monthly downloads][downloads-image]][downloads-url] [![Telegram bot][telegram-image]][telegram-url]
## Links
[https://github.com/EndyKaufman/kaufman-bot](https://github.com/EndyKaufman/kaufman-bot) - source code of bot
[https://telegram.me/KaufmanBot](https://telegram.me/KaufmanBot) - current bot in telegram
[https://kaufman-bot.site15.ru/graph](https://kaufman-bot.site15.ru/graph) - project graph
[https://github.com/kaufman-bot/schematics-example](https://github.com/kaufman-bot/schematics-example) - project generated with [@kaufman-bot/schematics](https://npmjs.org/package/@kaufman-bot/schematics)
[https://dev.to/endykaufman/series/16805](https://dev.to/endykaufman/series/16805) - kaufman-bot series articles in dev.io
# Usage
## Create application
Create empty nx project
> npx -y create-nx-workspace@15.0.13 --name=kaufman-bot-generated --preset=empty --interactive=false --nx-cloud=false
Go to created project
> cd kaufman-bot-generated
Add all need schematics
> npm install -D @nrwl/nest@15.0.13 @kaufman-bot/schematics
Create kaufman-bot application
> npx -y nx@15.0.13 g @kaufman-bot/schematics:app adam-bot --bot-name adam
Create telegram bot in @BotFather

Append token to env file
_.env.local_
```sh
TELEGRAM_BOT_TOKEN=5384981645:AAEKAfqNpZmoN1w5eQL2QxJtvY5h3O-71Zs
TELEGRAM_BOT_WEB_HOOKS_DOMAIN=
TELEGRAM_BOT_WEB_HOOKS_PATH=
TELEGRAM_BOT_ADMINS=
BOT_NAMES=adam
```
Check from telegram
> npm run serve:adam-bot-local
Search new bot

Start work with bot

Example of run commands

## Create library
Create new command
> npm run nx -- g @kaufman-bot/schematics:lib super
> 
Update app module
```ts
import { SuperModule } from '@kaufman-bot-generated/super';
...
@Module({
imports: [
...
SuperModule.forRoot(),
],
providers: [AppService],
})
export class AppModule {}
```
Restart application and check work in telegram

[npm-image]: https://badgen.net/npm/v/@kaufman-bot/core-server
[npm-url]: https://npmjs.org/package/@kaufman-bot/core-server
[telegram-image]: https://img.shields.io/badge/bot-telegram-blue.svg?maxAge=2592000
[telegram-url]: https://t.me/KaufmanBot
[downloads-image]: https://badgen.net/npm/dm/@kaufman-bot/core-server
[downloads-url]: https://npmjs.org/package/@kaufman-bot/core-server
# License
MIT