Skip to content

Commit 7cacde1

Browse files
committed
fix function duplicate
1 parent 6a3224c commit 7cacde1

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

sedenbot/modules/fun/carbon_text.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -82,43 +82,4 @@ def carbon(message):
8282
driver.quit()
8383

8484

85-
@sedenify(pattern='^.tts')
86-
def text_to_speech(message):
87-
reply = message.reply_to_message
88-
args = extract_args(message)
89-
if args:
90-
pass
91-
elif reply:
92-
if not reply.text:
93-
return edit(message, f'`{get_translation("ttsUsage")}`')
94-
args = reply.text
95-
else:
96-
edit(message, f'`{get_translation("ttsUsage")}`')
97-
return
98-
99-
try:
100-
gTTS(args, lang=TTS_LANG)
101-
except AssertionError:
102-
edit(message, f'`{get_translation("ttsBlank")}`')
103-
return
104-
except ValueError:
105-
edit(message, f'`{get_translation("ttsNoSupport")}`')
106-
return
107-
except RuntimeError:
108-
edit(message, f'`{get_translation("ttsError")}`')
109-
return
110-
tts = gTTS(args, lang=TTS_LANG)
111-
tts.save('h.mp3')
112-
with open('h.mp3', 'rb') as audio:
113-
linelist = list(audio)
114-
linecount = len(linelist)
115-
if linecount == 1:
116-
tts = gTTS(args, lang=TTS_LANG)
117-
tts.save('h.mp3')
118-
with open('h.mp3', 'r'):
119-
reply_voice(reply if reply else message, 'h.mp3', delete_file=True)
120-
121-
message.delete()
122-
send_log(get_translation('ttsLog'))
123-
12485
HELP.update({'carbon': get_translation('carbonInfo')})

0 commit comments

Comments
 (0)