From 6fd3fc216f3fba676dfb5e81d588dc415deca646 Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Thu, 21 Jan 2021 16:02:44 -0500 Subject: [PATCH] Updated Config --- badwords.py | 1 + config.py | 32 +++++++++++++++++++------------- utilities_script.py | 7 +++++++ 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 badwords.py diff --git a/badwords.py b/badwords.py new file mode 100644 index 0000000..b5b2eaf --- /dev/null +++ b/badwords.py @@ -0,0 +1 @@ +slurList = ("fag", "faggot", "niga", "nigga", "nigger", "retard", "tard", "rtard", "coon") \ No newline at end of file diff --git a/config.py b/config.py index 7d01feb..b7136e4 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,5 @@ from enum import Enum +import badwords as badwords credentialsNickname = "praxis_bot" @@ -8,10 +9,11 @@ discord_module: bool = False test_module: bool = False autoJoin_TwitchChannels = ["thecuriousnerd"] -whitelisted_TwitchPowerUsers = ["thecuriousnerd", "theredpoint", "lakotor"] +whitelisted_TwitchPowerUsers = ["thecuriousnerd"] -block_TwitchChannelsMessaging = [""] -blockAll_TwitchChatChannelsMessaging = False + +block_TwitchChannelsMessaging = [""] # Blocks the ability to send messages to twitch channels +blockAll_TwitchChatChannelsMessaging = False # Blocks the ability to send messages to twitch channels autoEnabled_TwitchChannelsTTS = False block_TwitchChannelsTTS = [""] # block supersedes the tts_enabled bool @@ -21,8 +23,9 @@ forceAll_TwitchChatChannelsTTS = False # forceAll supersedes the blockAll bool a blockAll_TTS_URL_Twitch = True -block_DiscordChannelsMessaging = [""] -blockAll_DiscordChannelsMessaging = False + +block_DiscordChannelsMessaging = [""] # Blocks the ability to send messages to Discord channels +blockAll_DiscordChannelsMessaging = False # Blocks the ability to send messages to Discord channels blockAll_DiscordPrivateMessaging = False # Private Messaging not yet implemented selected_DiscordTTSChannels = ["431129571308339210"] @@ -34,6 +37,12 @@ forceAll_DiscordChatChannelsTTS = False # forceAll supersedes the blockAll bool blockAll_TTS_URL_Discord = True + +skip_splashScreen = False +skip_splashScreenClear = False +skip_splashScreenSleep = False + + class Speaker(Enum): GOOGLE_TEXT_TO_SPEECH = 1 STREAMLABS_API = 2 @@ -106,15 +115,12 @@ class PollyVoices(Enum): Zeina = "Zeina" Zhiyu = "Zhiyu" - -botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") - -slurList = ("fag", "faggot", "niga", "nigga", "nigger", "retard", "tard", "rtard", "coon") - currentSpeaker = Speaker.GOOGLE_TEXT_TO_SPEECH fileNameStrategy = FileNameStrategy.CONTENT_BASED streamlabsVoice = PollyVoices.Justin -skip_splashScreen = False -skip_splashScreenClear = False -skip_splashScreenSleep = False + +botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") + +slurList = badwords.slurList + diff --git a/utilities_script.py b/utilities_script.py index 9b66fbb..1bff2e3 100644 --- a/utilities_script.py +++ b/utilities_script.py @@ -1,6 +1,7 @@ from asyncio.tasks import sleep import os import sys +import re import psutil import subprocess import platform @@ -10,6 +11,12 @@ import art clearScreen = lambda: os.system('cls' if os.name == 'nt' else 'clear') +urlMatcher = re.compile("(https?:(/{1,3}|[a-z0-9%])|[a-z0-9.-]+[.](com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw))") + +def contains_url(self, input: str): + containsURL = re.search(urlMatcher, input.lower()) is not None + return containsURL + def get_args(text: str) -> list: return text.split(" ")