Streamplace rpg.actor game chatbot (Clun's Cannon)
Be your own Streamplace chatbot to reply the game data from someone, using rpg.actor data
place.stream.chat.message- Lexicon

place.stream.chat.message- Operations
- Record created
Steps (6)
game- Value
clunscannon- Note
- The game name/code (must match the lexicon object)
- If
event.commit.record.streamerequals{{self}}- Chat message was sent in my channel - and
event.commit.record.textequals!cannon- Command trigger
Then
GameData- Fetches the game data- Lookup
at://{{event.did}}/actor.rpg.stats/{{game}}
- If
GameData.foundequalstrue- The game data exists
Then
Create a recordAction 1#1ReplyMessage
- Target Collection

place.stream.chat.message- Record Template
{ "createdAt": "{{now}}", "reply": { "parent": { "cid": "{{event.commit.cid}}", "uri": "{{event.uri}}" }, "root": { "cid": "{{event.commit.cid}}", "uri": "{{event.uri}}" } }, "streamer": "{{self}}", "text": "Your Clun's Cannon highscore: {{GameData.record.data.best}} ({{GameData.record.data.tries}} tries)" }
Otherwise
Create a recordAction 2#2NoDataMessage
- Target Collection

place.stream.chat.message- Record Template
{ "createdAt": "{{now}}", "reply": { "parent": { "cid": "{{event.commit.cid}}", "uri": "{{event.uri}}" }, "root": { "cid": "{{event.commit.cid}}", "uri": "{{event.uri}}" } }, "streamer": "{{self}}", "text": "Looks like you never played Clun's Cannon, no data found." }