File tree 1 file changed +11
-5
lines changed 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 24
24
25
25
gTTS = import_library ("gtts" ).gTTS
26
26
27
-
28
27
@Client .on_message (filters .command ("tts" , prefix ) & filters .me )
29
28
async def tts (client : Client , message : Message ):
30
- lang = message .command [1 ]
31
- text = " " .join (message .command [2 :])
29
+ if message .reply_to_message :
30
+ lang = message .command [1 ]
31
+ text = message .reply_to_message .text
32
+ else :
33
+ lang = message .command [1 ]
34
+ text = " " .join (message .command [2 :])
35
+
32
36
await message .edit ("<b>Speech synthesis...</b>" , parse_mode = enums .ParseMode .HTML )
33
37
34
38
try :
@@ -45,5 +49,7 @@ async def tts(client: Client, message: Message):
45
49
except Exception as e :
46
50
await message .edit (format_exc (e ), parse_mode = enums .ParseMode .HTML )
47
51
48
-
49
- modules_help ["tts" ] = {"tts [lang]* [text]*" : "Say text" }
52
+ modules_help ["tts" ] = {
53
+ "tts [lang]* [text]*" : "Say text" ,
54
+ "tts [lang]* replied message" : "Say text"
55
+ }
You can’t perform that action at this time.
0 commit comments