game#

Module to handle game creation and management

async src.game.collect_all_game_contexts(interaction, config, process_data)[source]#

Function to collect all necessary game contexts from user interactions.

Parameters:
  • interaction (Interaction) – Interaction object from Discord

  • config (Configuration) – App configuration

  • process_data (ProcessInput) – Input collection object

async src.game.inform_players(config, users, message_link)[source]#

Send a DM to each player to inform them about the new game.

Parameters:

Function to create a link to a specific Discord message.

Parameters:
  • config (Configuration) – App configuration

  • message (discord.Message) – General message object to collect ids

  • interaction (Interaction) – Last interaction to collect guild id

Returns:

Message link in the format

Return type:

str

async src.game.create_game(interaction, config)[source]#

Create a new game based on user inputs from Discord interactions.

Parameters:
  • interaction (Interaction) – Intgeraction object from Discord

  • config (Configuration) – App configuration

async src.game.keep_telling_schedule(interaction, config)[source]#

This function is the schedule to keep telling a story. It collects all necessary inputs from the user and write the next part of the story.

Parameters:
  • interaction (Interaction) – Interaction object

  • config (Configuration) – App configuration

async src.game.start_game_schedule(interaction, config, game_data)[source]#

This function the schedule to start a new game. It collects all necessary inputs from the user, gets the tale and character data from the database, creates the prompts for the LLM model, sends the requests and stores the responses in the database.

Parameters:
  • interaction (Interaction) – Interaction object

  • config (Configuration) – App configuration

  • game_data (ProcessInput) – Game data object

Returns:

Success status of the game start process

Return type:

bool

async src.game.setup_game(interaction, config)[source]#

Function game status with a select menu to choose the game status. The game status can be switched based on the current status of the game.

Parameters:
  • config (Configuration) – App configuration

  • interaction (Interaction) – Interaction object

Return type:

None

async src.game.reset_game(interaction, config)[source]#

This function resets a game and generates a new start story. Only possible if stories in the game with the status INIT.

Parameters:
  • interaction (Interaction) – Discrod interaction

  • config (Configuration) – App configuration

Return type:

None