From 9c0172b02180f89a748aad548f9c935b3e15f34f Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Mon, 26 Apr 2021 19:49:11 -0400 Subject: [PATCH] address/api fix --- lights_module.py | 2 +- rebuild_docker_and_run.bat | 8 ++++++++ standalone_discord_script.py | 2 +- standalone_twitch_pubsub.py | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 rebuild_docker_and_run.bat diff --git a/lights_module.py b/lights_module.py index 9e5fa9d..a3f0308 100644 --- a/lights_module.py +++ b/lights_module.py @@ -197,4 +197,4 @@ if __name__ == "__main__": #testModule.discordCredential = credentials_manager.find_Discord_Credential(config.credentialsNickname) testModule.main() - testModule.raveMode() \ No newline at end of file + #testModule.raveMode() \ No newline at end of file diff --git a/rebuild_docker_and_run.bat b/rebuild_docker_and_run.bat new file mode 100644 index 0000000..e3f449b --- /dev/null +++ b/rebuild_docker_and_run.bat @@ -0,0 +1,8 @@ +cd "c:\praxis" +docker-compose down +docker build --file Dockerfile_standalone_command --tag standalone_command . +docker build --file Dockerfile_standalone_channelRewards --tag standalone_channelrewards . +docker build --file Dockerfile_standalone_DiscordScript --tag standalone_discordscript . +docker build --file Dockerfile_standalone_TwitchScript --tag standalone_twitchscript . +docker build --file Dockerfile_standalone_Twitch_Pubsub --tag standalone_twitch_pubsub . +docker-compose up -d \ No newline at end of file diff --git a/standalone_discord_script.py b/standalone_discord_script.py index 8ece8a7..9f9c59c 100644 --- a/standalone_discord_script.py +++ b/standalone_discord_script.py @@ -94,7 +94,7 @@ 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}) - url = "http://standalone_command:6009/api/v1/exec?%s" % params + url = "http://standalone_command:6009/api/v1/exec_command?%s" % params resp = requests.get(url) if resp.status_code == 200: print("Got the following message: %s" % resp.text) diff --git a/standalone_twitch_pubsub.py b/standalone_twitch_pubsub.py index 5132622..aec0c4c 100644 --- a/standalone_twitch_pubsub.py +++ b/standalone_twitch_pubsub.py @@ -122,7 +122,7 @@ class Twitch_Pubsub(): clean_param = urlencode({'reward_name': rewardName, 'reward_type':rewardType}) print(rewardName, rewardType) #standalone_channelrewards - url = "http://localhost:6969/api/v1/reward?%s" % clean_param + url = "http://standalone_channelrewards:6969/api/v1/reward?%s" % clean_param resp = requests.get(url) return resp.status_code == 200 @@ -137,7 +137,7 @@ class Twitch_Pubsub(): 'bonus_data': realMessage}) #standalone_channelrewards - url = "http://localhost:6969/api/v1/exec_reward?%s" % params + url = "http://standalone_channelrewards:6969/api/v1/exec_reward?%s" % params resp = requests.get(url) if resp.status_code == 200: print("Got the following message: %s" % resp.text)