TinkerStorm / story-engine

A discord interactions service that provides a platform for interactive stories written by the community.

Home Page:https://tinkerstorm.github.io/story-engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Database support

sudojunior opened this issue · comments

While supporting repositories is one thing, database support is another. It is almost certain that the two will not be able to co-exist in the same environment, a choice which a self-hosting community would have to make for themselves.

interface Story {
  title: string;
  author: string;
  description: string;
  startsWith: string // resolve as Step
  steps: { [key: string]: StoryStep }
}

interface StoryStep {
  // readonly id: string // external
  payload: string | MessageOptions; // slash-create
  components: ComponentActionRow; // slash-create
  // route -> step, route -> one(steps), route -> one(steps, from: weights)
  routing: "end" | { [route: string]: string | string[] | [string, number][] }
}
  • steps has been referred to by GitHub Co-pilot as Scenes which would probably be a better name for them...
  • An array structure may be needed for Story#steps in the database environment due to how it stores entries.