Compare commits
7 Commits
user-clien
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a77a7d8fb | ||
|
|
b2544b9101 | ||
| 2343aff13d | |||
|
|
db0e63c933 | ||
|
|
18c4792b58 | ||
|
|
ea1a4a4b83 | ||
| 00aca55237 |
75
README.md
75
README.md
@ -2,27 +2,44 @@ An evolving chatbot to help users primarily with live stream production and effe
|
||||
|
||||
___
|
||||
|
||||
# Standalone V2 Info
|
||||
# Praxis Bot
|
||||
|
||||
## Docker:
|
||||
|
||||
This bot primarily uses docker to run various services.
|
||||
### Image Setup:
|
||||
|
||||
Use these commands to build the images.</br>
|
||||
`docker build --file Dockerfile_standalone_command --tag standalone_command .`</br>
|
||||
`docker build --file Dockerfile_standalone_channelRewards --tag standalone_channelrewards .`</br>
|
||||
`docker build --file Dockerfile_standalone_lights --tag standalone_lights .`</br>
|
||||
`docker build --file Dockerfile_standalone_DiscordScript --tag standalone_discordscript .`</br>
|
||||
`docker build --file Dockerfile_standalone_TwitchScript --tag standalone_twitchscript .`</br>
|
||||
`docker build --file Dockerfile_standalone_Twitch_Pubsub --tag standalone_twitch_pubsub .`</br>
|
||||
Use the following command to setup all the images.
|
||||
|
||||
Windows: `makedockerimages.bat`<br>
|
||||
Linux: `makedockerimages.sh`
|
||||
|
||||
|
||||
### Docker-Compose Info:
|
||||
|
||||
To Start:
|
||||
`docker-compose up -d`</br>
|
||||
`docker-compose up -d`<br>
|
||||
To Stop:
|
||||
`docker-compose down`</br>
|
||||
</br>
|
||||
`docker-compose down`<br>
|
||||
<br>
|
||||
___
|
||||
|
||||
### User TTS Speaker:
|
||||
To receive audio from standalone_tt_core.py launch standalone_tts_speaker.py.
|
||||
|
||||
`python standalone_tts_speaker.py`
|
||||
|
||||
or
|
||||
|
||||
windows: `praxis-tts-speaker.bat` Modify this to match the correct directory! Or no work for YOU!!!<br>
|
||||
linux: `praxis-tts-speaker.sh`<br>
|
||||
<br>
|
||||
___
|
||||
|
||||
### User Web Client:
|
||||
|
||||
To access the User Client visit `index.html` from `\user_client\v1\` in your browser.<br>
|
||||
<br>
|
||||
___
|
||||
|
||||
# Credentials:
|
||||
@ -30,9 +47,12 @@ ___
|
||||
## Credentials Setup:
|
||||
|
||||
Create a json based on the templates and put them into the `/credentials/` folder.
|
||||
Refer to the `/credential_templates/` folder for examples.
|
||||
Refer to the `/credential_templates/` folder for examples.<br>
|
||||
<br>
|
||||
|
||||
### For Twitch Credentials
|
||||
## For Twitch Credentials:
|
||||
|
||||
### Twitch IRC Chat Credentials:
|
||||
Username = `TwitchUsername` *(Must match ***credentialsNickname*** in config)*
|
||||
|
||||
Helix Client ID = `https://dev.twitch.tv/console/apps`
|
||||
@ -41,15 +61,34 @@ Oauth = `https://twitchapps.com/tmi/`
|
||||
|
||||
V5 Client ID = `https://twitchtokengenerator.com/`
|
||||
|
||||
### For Database Credentials
|
||||
### Twitch PubSub Credentials:
|
||||
|
||||
pubsub_client_id = `https://dev.twitch.tv/console/apps` Set url to `http://localhost:17563`
|
||||
pubsub_secret = `^Look at Instructions Above^`
|
||||
|
||||
pubsub_AccessToken = Generate by using: `python twitch_generate_credentials.py`
|
||||
pubsub_RefreshToken = `^Look at Instructions Above^`<br>
|
||||
<br>
|
||||
|
||||
## For Database Credentials:
|
||||
Will be replaced soon.<br>The current `db.py` file is not being used for now.<br>
|
||||
~~Nickname = `Anything You Want` *(Must match ***credentialsNickname*** in config)*~~
|
||||
|
||||
~~Engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`~~<br>
|
||||
<br>
|
||||
|
||||
## For Discord Credentials:
|
||||
Nickname = `Anything You Want` *(Must match ***credentialsNickname*** in config)*
|
||||
|
||||
Engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
||||
Token = `https://discord.com/developers/`<br>
|
||||
<br>
|
||||
|
||||
### For Discord Credentials
|
||||
Nickname = `Anything You Want` *(Must match ***credentialsNickname*** in config)*
|
||||
## Phue Credentials:
|
||||
The lights module will only be able to establish and generate credentials if the button on the bridge is pressed prior to running the script via:
|
||||
`python lights_module.py`<br>
|
||||
|
||||
Token = `https://discord.com/developers/`
|
||||
After running a credential file will be created in the user's home directory on their operating system called `.python_hue` this can then be moved into the credentials folder.<br>
|
||||
<br>
|
||||
|
||||
## Credential Usage:
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class ChannelReward_RubiksCube(AbstractChannelRewards, metaclass=ABCMeta):
|
||||
pass
|
||||
|
||||
def get_Phrase(self, defaultRewardPrompt,
|
||||
phrases = [""]):
|
||||
phrases = [" thinks its time to solve a cube "]):
|
||||
|
||||
phrases.append(defaultRewardPrompt)
|
||||
totalPhrases = len(phrases) - 1
|
||||
|
||||
@ -142,6 +142,6 @@ PollyVoice = PollyVoices.Justin
|
||||
#Misc Configs
|
||||
slurList = badwords.slurList
|
||||
|
||||
praxisVersion_Alpha = "A.0 "
|
||||
praxisVersion_Delta = "D.1 "
|
||||
praxisVersion_Omega = "O.0 "
|
||||
praxisVersion_Alpha = "0 " #Build
|
||||
praxisVersion_Delta = "1 " #Minor
|
||||
praxisVersion_Omega = "0.8 " #Major
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
from commands.command_base import AbstractCommand
|
||||
from enum import Enum
|
||||
import config as config
|
||||
import db
|
||||
|
||||
import commands.loader as command_loader
|
||||
|
||||
@ -10,7 +9,6 @@ import credentials
|
||||
class Help_Module():
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
#self.dbCredential: credentials.DB_Credential
|
||||
|
||||
def main(self):
|
||||
print("[Help Module]> help test")
|
||||
@ -68,7 +66,4 @@ Help_Module_ = Help_Module()
|
||||
if __name__ == "__main__":
|
||||
testModule = Help_Module()
|
||||
|
||||
#credentials_manager = credentials.Credentials_Module()
|
||||
#credentials_manager.load_credentials()
|
||||
#testModule.dbCredential = credentials_manager.find_DB_Credential(config.credentialsNickname)
|
||||
testModule.main()
|
||||
11
makedockerimages.sh
Normal file
11
makedockerimages.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
docker build --file Dockerfile_standalone_user_client.Dockerfile --tag standalone_user_client .
|
||||
docker build --file Dockerfile_standalone_eventlog.Dockerfile --tag standalone_eventlog .
|
||||
docker build --file Dockerfile_standalone_command.Dockerfile --tag standalone_command .
|
||||
docker build --file Dockerfile_standalone_channelRewards.Dockerfile --tag standalone_channelrewards .
|
||||
docker build --file Dockerfile_standalone_lights.Dockerfile --tag standalone_lights .
|
||||
docker build --file Dockerfile_standalone_tts_core.Dockerfile --tag standalone_tts_core .
|
||||
docker build --file Dockerfile_standalone_websource.Dockerfile --tag standalone_websource .
|
||||
docker build --file Dockerfile_standalone_DiscordScript.Dockerfile --tag standalone_discordscript .
|
||||
docker build --file Dockerfile_standalone_TwitchScript.Dockerfile --tag standalone_twitchscript .
|
||||
docker build --file Dockerfile_standalone_Twitch_Pubsub.Dockerfile --tag standalone_twitch_pubsub .
|
||||
2
praxis-tts-speaker.sh
Normal file
2
praxis-tts-speaker.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
python "c:\praxis\standalone_tts_speaker.py"
|
||||
@ -1,2 +0,0 @@
|
||||
cd "c:\praxis"
|
||||
python "c:\praxis\standalone_user_cli.py"
|
||||
@ -20,12 +20,9 @@ import utilities_script as utility
|
||||
import chyron_module
|
||||
import timers_module
|
||||
|
||||
import requests
|
||||
import random
|
||||
|
||||
import json
|
||||
from json import loads
|
||||
from urllib.parse import urlencode
|
||||
import base64
|
||||
|
||||
import event_logs.event_log_Module
|
||||
@ -77,38 +74,16 @@ def get_events():
|
||||
return flask.make_response("{\"message\":\"%s\"}" % payload.decode(), 200, {"Content-Type": "application/json"})
|
||||
|
||||
def reRunEvent_handler(eventName, eventTime, eventType, eventSender, eventData):
|
||||
returnString = attempt_Event_Rerun(eventName, eventTime, eventType, eventSender, eventData)
|
||||
return flask.make_response("{\"message\":\"%s\"}" % returnString, 200, {"Content-Type": "application/json"})
|
||||
attempt_Event_Rerun(eventName, eventTime, eventType, eventSender, eventData)
|
||||
return flask.make_response("{\"message\":\"%s\"}" % 'rerunning event....', 200, {"Content-Type": "application/json"})
|
||||
|
||||
def attempt_Event_Rerun(eventName, eventTime, eventType, eventSender, eventData):
|
||||
returnString = ""
|
||||
try:
|
||||
if "reward" in eventType:
|
||||
pass
|
||||
return returnString
|
||||
return flask.make_response("{\"message\":\"%s\"}" % returnString, 200, {"Content-Type": "application/json"})
|
||||
except:
|
||||
returnString = "Something Went Wrong!"
|
||||
return returnString
|
||||
|
||||
def attempt_Event_Rerun_Send(serviceName, servicePort, params):
|
||||
try:
|
||||
url = "http://"+ serviceName + ":"+ servicePort + "/api/v1/get_list/all"
|
||||
resp = requests.get(url)
|
||||
|
||||
if resp.status_code == 200:
|
||||
print("Got the following message: %s" % resp.text)
|
||||
data = loads(resp.text)
|
||||
msg = data['message']
|
||||
if msg is not None:
|
||||
praxis_logger_obj.log(msg)
|
||||
return msg
|
||||
# todo send to logger and other relevent services
|
||||
else:
|
||||
# todo handle failed requests
|
||||
return flask.make_response("{\"message\": \"%s\"}" % "Minor Mess up on attempt_Event_Rerun_Send", 200, {"Content-Type": "application/json"})
|
||||
except:
|
||||
return flask.make_response("{\"message\": \"%s\"}" % "Major Mess up on attempt_Event_Rerun_Send", 200, {"Content-Type": "application/json"})
|
||||
|
||||
return flask.make_response("{\"message\":\"%s\"}" % returnString, 200, {"Content-Type": "application/json"})
|
||||
|
||||
@api.route('/')
|
||||
def bot_StatusIcon():
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import config as config
|
||||
import db
|
||||
|
||||
|
||||
import credentials
|
||||
|
||||
class Test_Module():
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.dbCredential: credentials.DB_Credential
|
||||
|
||||
def main(self):
|
||||
print("[TEST Module]> test")
|
||||
@ -15,7 +14,4 @@ class Test_Module():
|
||||
if __name__ == "__main__":
|
||||
testModule = Test_Module()
|
||||
|
||||
credentials_manager = credentials.Credentials_Module()
|
||||
credentials_manager.load_credentials()
|
||||
testModule.dbCredential = credentials_manager.find_DB_Credential(config.credentialsNickname)
|
||||
testModule.main()
|
||||
@ -286,12 +286,26 @@
|
||||
<div class="col s12 center">
|
||||
<h1>Made by Alex Orid,<br> The Curious Nerd</h1>
|
||||
<h5>Need Help? Want to help out?<br><a href="https://discord.com/invite/sNTXWn4" target="_blank">Come visit my Discord</a></h5>
|
||||
<p>Version:<br> A:0 D:1 O:8</p>
|
||||
<p>Version:<br> A:0 D:1 O:0.8</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script src="js/materialize.js"></script>
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ async function updateEventList() {
|
||||
"<div class=\"col s12 m3\"><p>Event: <br>"+ eventName +"</p><br></div>"+
|
||||
"<div class=\"col s12 m3\"><p>User: <br>"+ eventSender +"</p><br></div>"+
|
||||
"<div class=\"col s12 m3\"><p>Message: <br>"+ eventData +"</p><br></div>"+
|
||||
'<a onclick="'+ reRunEvent_Params +'" class="btn waves-effect waves-light green right col s1" style="position: absolute; right: 0; top: 0; width: 3em;">'+
|
||||
'<a onclick="'+ reRunEvent_Params +'" class="hide btn waves-effect waves-light green right col s1" style="position: absolute; right: 0; top: 0; width: 3em;">'+
|
||||
"<i class=\"material-icons\">refresh</i>"+
|
||||
"</a></div>"
|
||||
$("#EventHistoryWrapper").prepend(template);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
from enum import Enum
|
||||
import time
|
||||
import config as config
|
||||
import db
|
||||
import tts
|
||||
|
||||
import credentials
|
||||
@ -16,7 +15,6 @@ import utilities_script as utility
|
||||
class User_Module():
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.dbCredential: credentials.DB_Credential
|
||||
self.MessageLog:list = []
|
||||
self.commands = command_loader.load_commands_new(AbstractCommand.CommandType.Praxis)
|
||||
self.UseFlagTypeMap = { # this is a mapping of the UserFlagTypes enum to function pointers
|
||||
@ -133,7 +131,4 @@ class UserFlag():
|
||||
if __name__ == "__main__":
|
||||
testModule = User_Module()
|
||||
|
||||
credentials_manager = credentials.Credentials_Module()
|
||||
credentials_manager.load_credentials()
|
||||
testModule.dbCredential = credentials_manager.find_DB_Credential(config.credentialsNickname)
|
||||
testModule.main()
|
||||
Loading…
Reference in New Issue
Block a user