feat: check if msg is empty after filtering
This commit is contained in:
@@ -71,6 +71,8 @@ class TTSListener implements Command {
|
|||||||
let msgFiltered = msg.content.replace(URL_REGEX, 'a link');
|
let msgFiltered = msg.content.replace(URL_REGEX, 'a link');
|
||||||
msgFiltered = msgFiltered.replace(DISCORD_REGEX, '');
|
msgFiltered = msgFiltered.replace(DISCORD_REGEX, '');
|
||||||
|
|
||||||
|
if (msgFiltered.length === 0) return;
|
||||||
|
|
||||||
const audio = await ttsModule.generate(voiceName, msgFiltered);
|
const audio = await ttsModule.generate(voiceName, msgFiltered);
|
||||||
|
|
||||||
if (audio?.data) {
|
if (audio?.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user