working version
This commit is contained in:
parent
5d1c442c29
commit
eb67d07b74
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user