telegram-voice-chatgpt-bot
/
README.MD
138 строк · 3.1 Кб
1<h1 align="center">Voice ChatGPT telegram bot</h1>
2
3<p align="center">
4<img src="logo.png" alt="Express">
5</p>
6
7<p align="center">
8<img src="https://img.shields.io/badge/NodeJS-18.13-green" alt="Node Version">
9<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
10</p>
11
12<div align="center"><h2>
13
14About: [^1]
15</h2></div>
16
17Telegram bot for voice communication with ChatGPT. The user sends a voice or text message to the bot and receives a text or voice message in response from ChatGPT. It is written in JavaScript and uses NodeJS.
18
19<div align="center"><h3>
20
21Features: [^2]
22</h2></div>
23
24- [x] The ability to choose a service for converting voice to text: using `OpenAI API` or `YandexSpeechKit API`
25- [x] Converting `.mp3 to text`: using `OpenAI API`.
26- [x] Converting `.ogg to text`: using `YandexSpeechKit API`
27- [x] Converting `.ogg to .mp3`: using `fluent-ffmpeg`.
28- [x] The user can choose how best to get an answer: by `text`, by `voice`, or all together.
29- [x] To convert text to voice message: using `YandexSpeechKit API` or `Google`
30- [x] ChatGPT remembers the context
31- [x] Whitelist of users who have access to the bot.
32- [x] Collecting simple statistics that includes the total number of requests, the number of voice requests, the number of text requests, the total number of words in all requests.
33- [x] The ability for users to see their statistics.
34- [x] Voice messages and text history chat are not saved on the server if the corresponding option is enabled
35- [x] The database is not used, all statistics and data are stored in `.json` format.
36> :warning: **If the bot work with a large audience, it is better to use a database.**
37
38
39<div align="center"><h2>
40
41Installation: [^3]
42</h2></div>
43
44```
45$ git clone https://github.com/Hashmann/telegram-voice-chatgpt-bot.git
46$ cd server
47```
48- Edit `.env.production` `.env.development` and set your telegram bot token and OpenAI key.
49- Edit `whitelist.user.json` and add the usernames to the whitelist.
50```
51$ npm install
52```
53
54<!-- <ul>
55<li><code>test</code></li>
56</ul> -->
57
58> :warning: **Do not delete directories:** `audio` and `log`
59
60<div align="center"><h2>
61
62Usage: [^4]
63</h2></div>
64
65
66<details>
67<summary>Development</summary>
68
69```
70$ npm run start:dev
71```
72</details>
73
74<details>
75<summary>Production</summary>
76
77```
78$ npm run start
79```
80</details>
81
82<div align="center"><h2>
83
84Dependencies: [^5]
85</h2></div>
86
87<details>
88<summary>Development</summary>
89
90- [Nodemon](https://www.npmjs.com/package/nodemon) ^2.0.20
91</details>
92
93<details>
94<summary>Production</summary>
95
96- [Dotenv (npm)](https://www.npmjs.com/package/dotenv) ^16.0.3
97</details>
98
99<!--
100<div align="center"><h2>
101
102[^6] TODO:
103</h2></div>
104
105<details>
106<summary>List one</summary>
107
108- [ ] Todo1
109- [ ] Todo2
110- [ ] Todo3
111</details>
112
113<details>
114<summary>List two</summary>
115
116- [ ] Todo4
117- [ ] Todo5
118- [ ] Todo6
119</details>
120-->
121
122<div align="center"><h2>Developer:</h2></div>
123
124[Yarkov Vyacheslav](https://github.com/Hashmann)
125
126<div align="center"><h2>License:</h2></div>
127
128[MIT license](https://opensource.org/licenses/MIT)
129
130
131[^1]: About
132[^2]: Features
133[^3]: Installation
134[^4]: Usage
135[^5]: Dependencies
136[^6]: TODO
137
138<div align="center"><sub align="center">May 2023</sub></div>
139