/tensorflow-ml-bot-example

🤖 Telegram Bot example using Machine Learning and Tensorflow

Primary LanguageTypeScript

Tensorflow Machine Learning Telegram Bot Example

Description

This repo contains an example of using tensorflow model together with Telegram Bots to analyze messages from users.

Requirements

You need to have node.js v16+ installed.
Here is the instruction how to install it.

Here is the way you can check your node version by using any shell:

> node -v                    
v16.13.0

Install

  1. Clone the repository:
git clone git@github.com:DrSmile444/tensorflow-ml-bot-example.git
  1. Install node_modules modules:
npm install
  1. Get bot token from bot father.
  2. Create a copy of .env.example and name it .env.
  3. Insert bot token into BOT_TOKEN in .env.

Run the bot

To run the bot, you need to execute the following command:

npm start

Branches

This project contains several branches with different stages of the bot:

  1. main - basic bot setup without tensorflow logic
  2. feature/tensorflow - complete bot setup with tensorflow

Technical stack

  1. Node.js v16 - is a JavaScript runtime built on Chrome's V8 JavaScript engine.
  2. TypeScript - is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
  3. Grammy - makes creating Telegram bots so simple you already know how to do it.
  4. ESLint - statically analyzes your code to quickly find problems. It is built into most text editors and you can run ESLint as part of your continuous integration pipeline.
  5. Prettier - is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.

Code editors

Here you can find a suggested code editors list

WebStorm (recommended)

WebStorm has built-in ESLint plugin support, so you need only enable it. The course lectors will use this IDE.

Visual Studio Code

VS Code includes built-in JavaScript IntelliSense, debugging, formatting, code navigation, refactorings, and many other advanced language features. To enable ESLint, you need to install ESLint plugin.

This repo contains VS Code suggested plugins, so you can install them in several clicks.