1
0
Fork 0

add discord commands and some examples of prompt syntax

This commit is contained in:
Sean Sube 2024-06-03 22:08:58 -05:00
parent 1c36bc8386
commit dd9e63bce3
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 42 additions and 2 deletions

View File

@ -96,6 +96,7 @@ please check out to [the documentation folder](./docs).
Detailed guides are available for: Detailed guides are available for:
- [admins](./docs/guides/admin.md) - [admins](./docs/guides/admin.md)
- [players](./docs/guides/player.md)
## Contributing ## Contributing

View File

@ -481,7 +481,6 @@ python3 -m taleweave.main \
--optional-actions \ --optional-actions \
--actions taleweave.systems.sim:init_actions \ --actions taleweave.systems.sim:init_actions \
--systems taleweave.systems.sim:init_logic --systems taleweave.systems.sim:init_logic
# TODO: add others
``` ```
This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down. This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down.

View File

@ -4,22 +4,62 @@
- [Player's Guide to TaleWeave AI](#players-guide-to-taleweave-ai) - [Player's Guide to TaleWeave AI](#players-guide-to-taleweave-ai)
- [Contents](#contents) - [Contents](#contents)
- [Discord Command Syntax](#discord-command-syntax)
- [Prompt Syntax](#prompt-syntax) - [Prompt Syntax](#prompt-syntax)
- [Prompt Function Syntax](#prompt-function-syntax) - [Prompt Function Syntax](#prompt-function-syntax)
## Discord Command Syntax
*Note 1:* Because TaleWeave AI offers a dynamic set of actions depending on the game world, it does not currently use
Discord's command feature. If you know a way to make this work with constantly-changing actions, please let me know.
*Note 2:* When interacting with the Discord bot, you need to ping it with each message. Your server admin can allow the
bot to see all messages, with and without pings, but you must ping the bot by default.
The Discord bot offers the following commands:
- `!taleweave` or the bot name, if your admin changed it
- prints the name of the active world
- `!help`
- prints the available commands and their parameters
- `!join <character>`
- join the game as the specified character
- `!leave`
- leave the game, if you are playing
- `!characters`
- list the available characters in the game
- `!players`
- list the players currently in the game
Other messages will be treated as in-character input and used as your character's action or reply, depending on the
current prompt.
## Prompt Syntax ## Prompt Syntax
The web client displays a menu with all of the available actions on your turn, but you can also input your own actions.
### Prompt Function Syntax ### Prompt Function Syntax
In order to call functions or use actions from your prompt replies, you (or more likely your GUI) can send valid JSON, In order to call functions or use actions from your prompt replies, you (or more likely your GUI) can send valid JSON,
or you can use this prompt function syntax. or you can use this prompt function syntax. Discord and the web client both support this syntax.
To use the prompt function syntax, start your prompt with `~` and use the syntax `~action:parameter=value,next=value` To use the prompt function syntax, start your prompt with `~` and use the syntax `~action:parameter=value,next=value`
where `action` is the name of the action (the function being called) and the remainder are parameters to be passed into where `action` is the name of the action (the function being called) and the remainder are parameters to be passed into
the function. the function.
For example:
```none
~action_move:direction=north
~action_tell:character=Alice,message=Hello
~action_use:item=potion
```
There are some limits on this syntax: There are some limits on this syntax:
- the function name cannot contain `:` - the function name cannot contain `:`
- this is true in Python as well and should not be a problem
- the parameter names cannot contain `=` - the parameter names cannot contain `=`
- this is also true in Python and should not be a problem
- the values cannot contain `,` - the values cannot contain `,`
- this is a problem and support for quotes is needed