Docker #24
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
3
tts.py
3
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)
|
||||
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user