Skip to content

Commit 5b42f57

Browse files
committed
Cleanify bot messages
Fix #55
1 parent 48953ab commit 5b42f57

File tree

3 files changed

+53
-31
lines changed

3 files changed

+53
-31
lines changed

EmailsToTelegramService/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>io.github.trashemail</groupId>
1212
<artifactId>imapclientservice</artifactId>
13-
<version>2.2.1</version>
13+
<version>2.2.2</version>
1414
<name>EmailsToTelegramService</name>
1515
<description>IMAP Client background services for TrashEmail</description>
1616

TrashEmailService/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>io.github</groupId>
1212
<artifactId>trashemail</artifactId>
13-
<version>2.2.1</version>
13+
<version>2.2.2</version>
1414
<name>Trashemail</name>
1515
<description>Springboot miscroservice - heart of Telegram @trashemail_bot</description>
1616
<distributionManagement>

TrashEmailService/src/main/java/io/github/trashemail/Telegram/TelegramRequestHandler.java

+51-29
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,17 @@ public TelegramResponse handleRequest(long chatId, String text) {
6969
switch(command){
7070
case "/start":
7171
responseText = "Thanks for joining ...\n" +
72-
"I am a disposable bot email id generator that can:\n" +
72+
"I am a *disposable email* id generator bot that " +
73+
"can:\n" +
7374
"1. Quickly generate a disposable email for you," +
7475
" no email management hassle \uD83D\uDE0B\t\n" +
75-
"2. Quickly delete those emailIds\n" +
76-
"3. Since I own, " +
77-
"*trashemail.in*, *humblemail.com* & *thromail.com* " +
78-
"your emailId will belong these domains\n" +
79-
"4. I dont read anything, I respect your privacy." +
80-
"Any doubt? Audit my source code." +
81-
"\n\n" +
82-
"I am still a baby and learning.\n" +
83-
"Do you have idea for addon? " +
84-
"Please feel free to reach @" +
85-
" https://github.com/r0hi7/Trashemail" +
86-
" and raise an issue. " +
87-
"I will definitely work out on that" +
88-
"\n\n" +
76+
"2. Quickly delete those email addresses\n" +
77+
8978
"For now to get started try\n" +
90-
"* /create <user>@("+
91-
String.join("|", emailServerConfig.getHosts()) +")\n" +
92-
"* /delete emailId\n" +
79+
"* /create <user>\n" +
80+
"* /delete\n" +
9381
"* /help\n" +
94-
"* /emails\n";
82+
"* /list_ids\n";
9583

9684
return new TelegramResponse(
9785
chatId,
@@ -279,25 +267,24 @@ else if(argument == null) {
279267
responseText = "Create disposable email addresses to " +
280268
"protect you against spam and newsletters." +
281269
"E-Mail forwarding made easy.\n" +
282-
"I am open source and runs on open source services." +
283-
"You can find my heart, soul and brain at:" +
284-
" https://github.com/r0hi7/Trashemail\n\n"+
270+
"I am open source and runs on open source services.\n" +
271+
285272
"Currently, I support:\n" +
286273
"/create - That can get you one(or more) " +
287274
"custom disposable emails.\n" +
288275
"/delete - If you are getting spams for any mail id, " +
289276
"just delete it because it is disposable.\n" +
290-
"/emails - Get the list of all the emailIds " +
277+
"/list_ids - Get the list of all the email Ids "+
291278
"that belongs to you.\n" +
292279
"/help - this help message.\n";
293280
return new TelegramResponse(
294281
chatId,
295282
responseText
296283
);
297284

298-
case "/emails":
299-
String response = "Currently, you have below mentioned " +
300-
"emails with you.\n*";
285+
case "/list_ids":
286+
String response = "Currently, you have these email ids with " +
287+
"you. \n";
301288
List<User> allEmailsWithUser =
302289
userRepository.findByChatIdAndIsActiveTrue(
303290
chatId);
@@ -306,7 +293,6 @@ else if(argument == null) {
306293
response += emailWithUser + "\n";
307294
}
308295

309-
response+="*";
310296
return new TelegramResponse(
311297
chatId,
312298
response
@@ -405,13 +391,49 @@ else if(argument == null) {
405391

406392
break;
407393

394+
case "/follow":
395+
String follow_response = "Follow me on: \n" +
396+
"Twitter : https://twitter.com/sehgal_rohit" +
397+
"GitHub : https://github.com/r0hi7";
398+
399+
return new TelegramResponse(
400+
chatId,
401+
follow_response
402+
);
403+
404+
case "/sponsor":
405+
String sponsor_response = "Average running cost of this " +
406+
"per-month is $30, if you like the idea and would " +
407+
"like to sponsor then you can buy me a " +
408+
"coffee: https://www.buymeacoffee.com/r0hi7";
409+
return new TelegramResponse(
410+
chatId,
411+
sponsor_response
412+
);
413+
414+
case "/like":
415+
String like_response = "*If* you like the idea and this " +
416+
"product, do drop a star at github repo (where my " +
417+
"hear and soul lives).\n Every star " +
418+
"really " +
419+
"motivates me :)\n"+
420+
"https://github.com/TrashEmail/TrashEmail";
421+
return new TelegramResponse(
422+
chatId,
423+
like_response
424+
);
425+
408426
default:
409-
responseText = "I dont understand that ...\n " +
427+
responseText = "I don't understand that ...\n " +
410428
"I only understand few commands.\n" +
411429
"1. /create <user>\n" +
412430
"2. /delete\n" +
413431
"3. /help\n" +
414-
"4. /emails\n";
432+
"4. /list_ids\n"+
433+
"5. /follow\n" +
434+
"6. /like\n"+
435+
"7. /sponsor";
436+
415437
return new TelegramResponse(
416438
chatId,
417439
responseText

0 commit comments

Comments
 (0)