diff --git a/README.md b/README.md
index 8397656..1c2bb00 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,11 @@
# cyoa-discord
-[NO AI USAGE]
-Simple choose your own adventure story hosted over Discord's new link embed V2 system, controlled with sed commands to edit your message's query value
\ No newline at end of file
+[NO AI USAGE]
+Simple choose your own adventure story hosted over Discord's new link embed V2 system, controlled with sed commands to edit your message's query value
+
+it's cache friendly as well, since the same code will always have the same result
+stories are easy to store as json files
+and you can switch between stories through pathing
+main page also displays how to play the game (WIP)
+
+this is just a fun little test I wanted to try with discords new scraper embed system they announced
diff --git a/main.html b/main.html
new file mode 100644
index 0000000..afdd466
--- /dev/null
+++ b/main.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+ Test
+
+
+test
+
+
\ No newline at end of file
diff --git a/server.py b/server.py
index 4d2fc3a..82d32bf 100644
--- a/server.py
+++ b/server.py
@@ -5,17 +5,21 @@ app = Flask(__name__)
@app.route("/")
-def game():
+def mainPage():
+ return open("main.html").read()
+
+@app.route("/")
+def game(path):
+ if "Discord" not in str(request.user_agent):
+ return mainPage()
gamecode = request.args.get('code')[:-1]
-
- #return open("page copy.html", "r").read()
- #print(buildHTML(gamecode))
-
- return buildHTML(gamecode)
+ gameName = request.path[1:]
+ print(gameName)
+ return buildHTML(gamecode,gameName)
-def buildHTML(gamecode):
- with open("story.json", "r") as f:
+def buildHTML(gamecode, gameName):
+ with open("stories/" + gameName.replace(".", "") + ".json", "r") as f:
print("\n\n")
story = json.loads(f.read())
nodeName = "start"
diff --git a/story copy.json b/stories/test.json
similarity index 100%
rename from story copy.json
rename to stories/test.json
diff --git a/story.json b/stories/water-willow.json
similarity index 100%
rename from story.json
rename to stories/water-willow.json