Skip to content

Commit dd9e63b

Browse files
committed
add discord commands and some examples of prompt syntax
1 parent 1c36bc8 commit dd9e63b

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ please check out to [the documentation folder](./docs).
9696
Detailed guides are available for:
9797

9898
- [admins](./docs/guides/admin.md)
99+
- [players](./docs/guides/player.md)
99100

100101
## Contributing
101102

docs/guides/admin.md

-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ python3 -m taleweave.main \
481481
--optional-actions \
482482
--actions taleweave.systems.sim:init_actions \
483483
--systems taleweave.systems.sim:init_logic
484-
# TODO: add others
485484
```
486485

487486
This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down.

docs/guides/player.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,62 @@
44

55
- [Player's Guide to TaleWeave AI](#players-guide-to-taleweave-ai)
66
- [Contents](#contents)
7+
- [Discord Command Syntax](#discord-command-syntax)
78
- [Prompt Syntax](#prompt-syntax)
89
- [Prompt Function Syntax](#prompt-function-syntax)
910

11+
## Discord Command Syntax
12+
13+
*Note 1:* Because TaleWeave AI offers a dynamic set of actions depending on the game world, it does not currently use
14+
Discord's command feature. If you know a way to make this work with constantly-changing actions, please let me know.
15+
16+
*Note 2:* When interacting with the Discord bot, you need to ping it with each message. Your server admin can allow the
17+
bot to see all messages, with and without pings, but you must ping the bot by default.
18+
19+
The Discord bot offers the following commands:
20+
21+
- `!taleweave` or the bot name, if your admin changed it
22+
- prints the name of the active world
23+
- `!help`
24+
- prints the available commands and their parameters
25+
- `!join <character>`
26+
- join the game as the specified character
27+
- `!leave`
28+
- leave the game, if you are playing
29+
- `!characters`
30+
- list the available characters in the game
31+
- `!players`
32+
- list the players currently in the game
33+
34+
Other messages will be treated as in-character input and used as your character's action or reply, depending on the
35+
current prompt.
36+
1037
## Prompt Syntax
1138

39+
The web client displays a menu with all of the available actions on your turn, but you can also input your own actions.
40+
1241
### Prompt Function Syntax
1342

1443
In order to call functions or use actions from your prompt replies, you (or more likely your GUI) can send valid JSON,
15-
or you can use this prompt function syntax.
44+
or you can use this prompt function syntax. Discord and the web client both support this syntax.
1645

1746
To use the prompt function syntax, start your prompt with `~` and use the syntax `~action:parameter=value,next=value`
1847
where `action` is the name of the action (the function being called) and the remainder are parameters to be passed into
1948
the function.
2049

50+
For example:
51+
52+
```none
53+
~action_move:direction=north
54+
~action_tell:character=Alice,message=Hello
55+
~action_use:item=potion
56+
```
57+
2158
There are some limits on this syntax:
2259

2360
- the function name cannot contain `:`
61+
- this is true in Python as well and should not be a problem
2462
- the parameter names cannot contain `=`
63+
- this is also true in Python and should not be a problem
2564
- the values cannot contain `,`
65+
- this is a problem and support for quotes is needed

0 commit comments

Comments
 (0)