chyron-&-text-updater-commands #37

Merged
alex_orid merged 5 commits from chyron-&-text-updater-commands into v2.0 2021-04-30 18:17:36 +00:00
2 changed files with 20 additions and 9 deletions
Showing only changes of commit eb67d07b74 - Show all commits

View File

@ -29,19 +29,24 @@ class Command_chyron_v2(AbstractCommand, metaclass=ABCMeta):
self.isCommandEnabled = True
def do_command(self, source = AbstractCommand.CommandSource.default, user = "User", command = "", rest = "", bonusData = None):
returnString = ""
praxis_logger_obj.log("\n Command>: " + command + rest)
returnString = "trying to update chyron..."
praxis_logger_obj.log("\n Command>: " + command + " " + rest)
for name in config.adminUsers_List:
print(name)
tempName = user.lower()
if name == tempName:
returnString = user + " has updated the chyron!"
chyron_ = chyron_module.Chyron_Module()
chyron_.main(rest)
chyron_.chyron_stringUpdater()
chyron_.updateChyronFile()
returnString = chyron_.chyron_computedString
try:
returnString = user + " has updated the chyron!"
chyron_ = chyron_module.Chyron_Module()
chyron_.main(rest)
chyron_.chyron_stringUpdater()
chyron_.updateChyronFile()
except:
returnString = user + " has attempted to update the chyron but an error may have occurred!"
#returnString = chyron_.chyron_computedString
return returnString

View File

@ -111,7 +111,13 @@ class Discord_Module(discord.Client):
async def exec_command(self, realMessage: discord.Message, command: str, rest: str):
# todo need to url-escape command and rest
params = urlencode({'command_source': commands.command_base.AbstractCommand.CommandSource.Discord, 'user_name': realMessage.author.mention, 'command_name': command, 'rest': rest, 'bonus_data': realMessage})
params = urlencode(
{'command_source': commands.command_base.AbstractCommand.CommandSource.Discord,
'user_name': realMessage.author.mention,
'command_name': command,
'rest': rest,
'bonus_data': realMessage})
url = "http://standalone_command:6009/api/v1/exec_command?%s" % params
resp = requests.get(url)
if resp.status_code == 200: