How to use %crow
An Urbit Chat Bot
Instructions
Every command entered in dojo to control crow will be prefixed by :crow &crow-flap
`:: assorted types for use in other types
::
+$ rol @t
+$ act @tas
+$ rul [rol act]
::
:: crow's actions
::
+$ flap
$% [%teach =act ack=(list content)] :: train a new response
[%scare =act ack=(list content)] :: remove a response
[%think res=resource =rul] :: associate a string with a response
[%steal res=resource =rul] :: stop serving a resource w/ a tag
[%treat ~] :: toggle nut`
:crow &crow-flap [%treat ~] will toggle it on and off
A resource is the [~sampel-palnet %chat-name]
First, teach it something (that %my-first-command => ~[[%text 'this comment in chat']]) using :crow &crow-flap [%teach %my-first-command ~[[%text 'this comment in chat']]]
Then associate that with a resource and some input in chat :crow &crow-flap [%think [~zod %my-chat] ['!thiscommand' %my-first-command]]
%scare is the opposite of %teach and %steal the opposite of %think
Examples
If you want the chatbot to say welcome, how may I help you? when you type the word !hi into the chat.
For this example we will use a test chat located at ~navluc-latmes/chat-bot-test. The chat url is ~navluc-latmes/chatbot-8888
Make sure your ship has joined the chat that we will be sending messages to.
Install the %crow app on a ship that is not hosting the chat (i.e. a moon).
~magped-magped-rabsef-bicrym/crowOpen the Dojo Terminal
Turn on %crow
:crow &crow-flap [%treat ~]Teach it a command
:crow &crow-flap [%teach %welcome-command ~[[%text 'welcome, how may I help you?']]]Then associate the command with a chat room and initiation phrase
:crow &crow-flap [%think [~navluc-latmes %chatbot-8888] ['!hi' %welcome-command]]