Deleted Spaces

This commit is contained in:
Alex Orid 2020-11-19 15:54:05 -05:00
parent 8f2ae75dc8
commit f518c31a98
4 changed files with 14 additions and 16 deletions

View File

@ -140,7 +140,7 @@ class Credentials_Module():
return tempCert
else:
return None
def find_Discord_Credential(self, searchParam: str):
print("Searching for Discord Credential named: " + searchParam)
foundSomething = False
@ -169,8 +169,7 @@ class Credentials_Module():
else:
return None
credentialLoadingFunctions = { # this is a mapping of the Credential enum to function pointers
Credential.Twitch_Credential: load_Twitch_Credential,
Credential.Discord_Credential: load_Discord_Credential,

2
db.py
View File

@ -20,7 +20,7 @@ class db_module():
createEngine = False
else:
credential = self.dbCredential
if createEngine:
self.engine = create_engine(credential.engine_url)
self.currentWorkingDB = credential.databaseName

View File

@ -42,7 +42,7 @@ class Discord_Module(discord.Client):
def main(self):
print("starting loop")
self.loop.create_task(self.startup())
self.loop.run_forever()
self.loop.run_forever()
async def on_ready(self):
print('Logged on as', self.user)
@ -52,12 +52,12 @@ class Discord_Module(discord.Client):
print(message.content)
#print(message.channel.id)
#Message ID
#print(str(message.id))
#print(str(message.id))
#print(str(message.channel.id))
if message.content == "//testing":
await message.channel.send('test response')
#test = self.get_channel(431129571308339210)
#await test.send("testerino")
#await test.send("testerino")
if not await self.isSenderBot(message):
# This will check for the praxis_bot-tts channel and will TTS stuff from there.
@ -67,14 +67,14 @@ class Discord_Module(discord.Client):
await self.eval_commands(message)
#await self.tts_message(message)
async def eval_triggeredEvents(self, message: discord.Message):
# This will check for the selected channels and will TTS stuff from there.
for channel in self.selected_ttsChannels:
if channel == message.channel.id:
await self.tts_message(message)
async def eval_automaticEvents(self, message: discord.Message):
pass
@ -85,7 +85,7 @@ class Discord_Module(discord.Client):
try:
#first_space_idx = message.text.index(' ')
# This fixes a error where if you send a command without arguments it fails because
# This fixes a error where if you send a command without arguments it fails because
# it cant find the substring.
if message.content.find(" ") != -1:
first_space_idx = message.content.index(' ')
@ -123,7 +123,7 @@ class Discord_Module(discord.Client):
# Checks for basic slurs.
async def contains_slur(self, message: discord.Message):
containsSlur: bool = False
if await self.slur_check(message.content) or await self.slur_check(message.author.display_name):
containsSlur = True
@ -153,7 +153,7 @@ class Discord_Module(discord.Client):
isBot = True
print("<{ bot detected! }> ")
return isBot
@ -168,4 +168,3 @@ if __name__ == "__main__":
testModule.main()

View File

@ -40,7 +40,7 @@ def discord_module_init(dbCert, discordCert):
def thread_main():
global twitch_chat
global discord_connection
global discord_connection
global credentials_manager
twitch_chat = twitch_script.Twitch_Module()
@ -62,12 +62,12 @@ def thread_main():
threads.append(discord)
discord.start()
print("---Post Thread Creation Test---")
print("---Post Thread Creation Test---")
for t in threads:
t.join()
print("---Point of no return---")