diff --git a/config.py b/config.py index cd67c70..a30d345 100644 --- a/config.py +++ b/config.py @@ -30,8 +30,8 @@ block_DiscordChannelsMessaging = [""] # Blocks the ability to send messages to D blockAll_DiscordChannelsMessaging = False # Blocks the ability to send messages to Discord channels blockAll_DiscordPrivateMessaging = False # Private Messaging not yet implemented -selected_DiscordTTSChannels = ["431129571308339210"] autoEnabled_DiscordChannelsTTS = False +selected_DiscordTTSChannels = ["431129571308339210"] block_DiscordChannelsTTS = [""] # block supersedes the tts_enabled bool blockAll_DiscordChannelsTTS = False # blockAll supersedes the force bool and force list and tts_enabled bool force_DiscordChannelsTTS = [""] # force supersedes the block list diff --git a/discord_script.py b/discord_script.py index 28a212d..bba7c16 100644 --- a/discord_script.py +++ b/discord_script.py @@ -138,7 +138,13 @@ class Discord_Module(discord.Client): #print("isBlocked: " + str(isBlocked)) #print("isForced: " + str(isForced)) if (not await self.contains_slur(message)) and (await self.isTTS_URL_Enabled(message)): - if self.tts_enabled and not isBlocked and not config.blockAll_DiscordChannelsTTS or isForced or config.forceAll_DiscordChatChannelsTTS: + print(message.channel.id, message.channel.id, message.channel.id) + isMessageChannelInList = False + for TTS_C_id in config.selected_DiscordTTSChannels: + print(TTS_C_id) + if int(TTS_C_id) == int(message.channel.id): + isMessageChannelInList = True + if self.tts_enabled and (isMessageChannelInList) and not isBlocked and not config.blockAll_DiscordChannelsTTS or isForced or config.forceAll_DiscordChatChannelsTTS: if not message.content.startswith('!'): text_to_say: str = "%s says, %s" % (message.author.display_name, message.content) channel_text = "%s user msg" % message.channel diff --git a/tts.py b/tts.py index 116c990..6e026aa 100644 --- a/tts.py +++ b/tts.py @@ -13,9 +13,10 @@ streamLabsUrl = "https://streamlabs.com/polly/speak" def tts(inputText: str, *args): outpath = create_speech_file(inputText) - if utility.isRunningInDocker() == False: + if utility.isRunningInDocker() == True: print("Docker Detected, skipping playsound()") else: + print("Playing Sound...") playsound(outpath) diff --git a/user_module.py b/user_module.py index 3e7becc..823b2ce 100644 --- a/user_module.py +++ b/user_module.py @@ -21,7 +21,7 @@ class User_Module(): def main(self): print("\nWaiting on User input...\n") inputLoop = True - if utility.isRunningInDocker() == False: + if utility.isRunningInDocker() == True: inputLoop = False print("\nNo User's Input Allowed") while inputLoop: