Programmable Chat
In a desktop session, subscribe to the one-liner demo channel and notice a new "chat" notebook window.
In[1]:=
![Click for copyable input](assets.en/programmable-chat/In_30.png)
listener = ChannelListen["Demos:Oneliner"]
Out[1]=
![](assets.en/programmable-chat/O_30.png)
Out[2]=
![](assets.en/programmable-chat/O_31.png)
Send a text to the channel and see it appended to the chat notebook.
In[3]:=
![Click for copyable input](assets.en/programmable-chat/In_31.png)
ChannelSend["Demos:Oneliner", "hello"]
Out[3]=
![](assets.en/programmable-chat/O_32.png)
Out[4]=
![](assets.en/programmable-chat/O_33.png)
Send a command.
In[5]:=
![Click for copyable input](assets.en/programmable-chat/In_32.png)
ChannelSend["Demos:Oneliner", Unevaluated[Speak["gotcha"]]]
Out[5]=
![](assets.en/programmable-chat/O_34.png)
Out[6]=
![](assets.en/programmable-chat/O_35.png)
Send a command by typing it in the input field at the bottom of the chat notebook and pressing the Return key.
Out[7]=
![](assets.en/programmable-chat/O_36.png)
You might also see messages from all other authenticated users who happen to send messages to the channel at this time, until you unsubscribe.
In[8]:=
![Click for copyable input](assets.en/programmable-chat/In_33.png)
RemoveChannelListener[listener]
Out[8]=
![](assets.en/programmable-chat/O_37.png)