You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-6Lines changed: 50 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
The Unthread Telegram Bot seamlessly connects your Telegram community with Unthread's powerful ticket management system. This official integration transforms how you handle support requests by enabling users to create and manage tickets directly within Telegram.
8
8
9
-
With simple commands and intuitive interactions, support tickets automatically sync between both platforms, streamlining your workflow and improving response times. Whether you're managing a community group, running a business chat, or supporting an open-source project, this bot provides the tools you need for efficient, organized customer support.
9
+
With simple commands and intuitive interactions, support tickets automatically sync between both platforms, streamlining your workflow and improving response times. Users receive real-time notifications when ticket status changes, ensuring they stay informed throughout the support process. Whether you're managing a community group, running a business chat, or supporting an open-source project, this bot provides the tools you need for efficient, organized customer support.
10
10
11
11
## πΈ Sponsored Ads
12
12
@@ -19,22 +19,27 @@ Open source development is resource-intensive. These **sponsored ads help keep L
19
19
The Unthread Telegram Bot creates a seamless bridge between your Telegram group chats and Unthread's ticket management system. Here's how it works:
20
20
21
21
### **π₯ Ticket Creation**
22
+
22
23
- Users in group chats can create support tickets using the `/support` command
23
24
- The bot guides them through a simple conversation to collect issue summary and email (optional)
24
25
- Tickets are automatically created in Unthread with proper customer and user association
25
26
26
-
### **π Bidirectional Communication**
27
+
### **π Bidirectional Communication**
28
+
27
29
-**Agent β User**: When agents respond via the Unthread dashboard, messages are delivered to Telegram in real-time through webhook processing
28
30
-**User β Agent**: Users can simply reply to agent messages naturally - no special commands needed
31
+
-**Status Notifications**: Receive real-time notifications when ticket status changes (Open/Closed) with clear messaging and emoji indicators
29
32
-**Conversation Flow**: Maintains complete conversation history across both platforms using message reply chains
30
33
-**Webhook Server**: Powered by [`wgtechlabs/unthread-webhook-server`](https://github.com/wgtechlabs/unthread-webhook-server) which processes Unthread webhooks and queues events in Redis for real-time delivery
31
34
32
35
### **π’ Smart Customer Management**
36
+
33
37
- Automatically extracts customer company names from group chat titles (e.g., "Company X Relay" β "Company X")
34
38
- Creates customers in Unthread with `[Telegram]` prefix for platform identification
35
39
- Maps Telegram users to Unthread user profiles with fallback email generation
36
40
37
41
### **πΎ Multi-Layer Storage**
42
+
38
43
-**Memory Layer** (24h): Fast access for active conversations
39
44
-**Redis Layer** (3 days): Intermediate caching for recent activity
40
45
-**PostgreSQL** (permanent): Long-term storage with full conversation history
@@ -44,7 +49,8 @@ The Unthread Telegram Bot creates a seamless bridge between your Telegram group
44
49
This bot works in conjunction with the [`wgtechlabs/unthread-webhook-server`](https://github.com/wgtechlabs/unthread-webhook-server) to enable real-time bidirectional communication. Here's how the complete system works:
- Webhook-based real-time event processing from Unthread via [`wgtechlabs/unthread-webhook-server`](https://github.com/wgtechlabs/unthread-webhook-server)
94
109
- Redis queue system for reliable webhook event processing and delivery
95
110
- Graceful degradation when services are unavailable
96
111
- Comprehensive error handling and recovery mechanisms
97
112
98
113
### **β‘ Developer Experience**
114
+
99
115
- Built with modern ES6+ modules and async/await patterns
100
116
- Structured logging with `@wgtechlabs/log-engine` integration
101
117
- Auto-setup database schema on first run
102
118
- Clean separation of concerns with SDK architecture
103
119
104
120
### **π§ Flexible Configuration**
121
+
105
122
- Environment variable based configuration
106
123
- Support for both basic mode (ticket creation only) and full mode (with webhooks)
107
124
- Configurable webhook polling intervals and queue names
@@ -162,6 +179,7 @@ That's it! The database schema will be created automatically on first run.
162
179
[](https://railway.com/u/warengonzaga)
163
180
164
181
#### **π³ Docker Support**
182
+
165
183
```bash
166
184
# Coming soon - Docker deployment support
167
185
docker-compose up -d
@@ -181,6 +199,7 @@ docker-compose up -d
181
199
The bot provides several commands for users and administrators:
182
200
183
201
#### **User Commands**
202
+
184
203
-`/start` - Welcome message and bot introduction
185
204
-`/help` - Display available commands and usage instructions
186
205
-`/support` - Create a new support ticket (group chats only)
@@ -193,7 +212,7 @@ The bot provides several commands for users and administrators:
193
212
3.**Email (Optional)**: Provide email or skip for auto-generated one
194
213
4.**Confirmation**: Receive ticket number and confirmation message
195
214
196
-
```
215
+
```text
197
216
User: /support
198
217
Bot: Let's create a support ticket. Please provide your issue summary:
199
218
@@ -209,40 +228,50 @@ Bot: π« Support Ticket Created Successfully!
209
228
### **Agent Workflow**
210
229
211
230
#### **Receiving Tickets**
231
+
212
232
- New tickets appear in your Unthread dashboard
213
233
- Customer name shows as `[Telegram] GroupChatName`
214
234
- User information includes Telegram username and ID
215
235
216
236
#### **Responding to Users**
237
+
217
238
- Reply to tickets in Unthread dashboard as normal
218
239
- Messages are automatically delivered to the original Telegram group
219
240
- Users receive agent responses in real-time
220
241
221
242
#### **Ongoing Conversations**
243
+
222
244
- Users can reply directly to agent messages in Telegram
223
245
- No special commands needed - natural conversation flow
224
246
- All replies are automatically sent back to Unthread
247
+
-**Status Updates**: Users receive real-time notifications when tickets are closed (π) or reopened (π)
248
+
-**Reply Status**: Message reactions show reply status (β³ sending β β sent successfully / β error)
249
+
- Status notifications include clear messaging about next steps and reply to original ticket messages
225
250
226
251
### **Group Chat Setup**
227
252
228
253
#### **Adding the Bot**
254
+
229
255
1. Add your bot to the desired Telegram group chat
230
256
2. Ensure the bot has permission to read and send messages
231
257
3. Group chat title should ideally include customer company name
232
258
233
259
#### **Best Practices**
260
+
234
261
- Use descriptive group chat names (e.g., "Acme Corp Support", "ClientName x YourCompany")
235
262
- The bot automatically extracts customer names from chat titles
236
263
- Only group members can create support tickets (private chats are blocked)
237
264
238
265
### **Admin Features**
239
266
240
267
#### **Customer Management**
268
+
241
269
- Customers are automatically created from group chat names
242
270
- Duplicate prevention ensures one customer per chat
243
271
- Customer names are prefixed with `[Telegram]` for easy identification
244
272
245
273
#### **Conversation Tracking**
274
+
246
275
- Each ticket maintains complete conversation history
247
276
- Reply chains preserve context across platforms
248
277
- Message metadata includes user information and timestamps
@@ -256,32 +285,39 @@ Bot: π« Support Ticket Created Successfully!
256
285
-**PostgreSQL 12+** (primary database)
257
286
-**Redis 6+** (optional, for enhanced performance)
258
287
288
+
> **β οΈ Package Manager Notice:** This project enforces the use of Yarn and will prevent npm installation attempts. If you try to use `npm install`, you'll receive an error message with instructions to use Yarn instead.
Join our community discussions to get help, share ideas, and connect with other users:
360
404
361
405
- π£ **[Announcements](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/announcements)**: Official updates from the maintainer
362
-
- πΈ **[Showcase](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/showcase)**: Show and tell your implementation
406
+
- πΈ **[Showcase](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/showcase)**: Show and tell your implementation
363
407
- π **[Wall of Love](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/wall-of-love)**: Share your experience with the bot
364
408
- π **[Help & Support](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/help-support)**: Get assistance from the community
365
409
- π§ **[Ideas](https://github.com/wgtechlabs/unthread-telegram-bot/discussions/categories/ideas)**: Suggest new features and improvements
0 commit comments