Wolfram Language

Channel Framework

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
listener = ChannelListen["Demos:Oneliner"]
Out[1]=
Out[2]=

Send a text to the channel and see it appended to the chat notebook.

In[3]:=
Click for copyable input
ChannelSend["Demos:Oneliner", "hello"]
Out[3]=
Out[4]=

Send a command.

In[5]:=
Click for copyable input
ChannelSend["Demos:Oneliner", Unevaluated[Speak["gotcha"]]]
Out[5]=
Out[6]=

Send a command by typing it in the input field at the bottom of the chat notebook and pressing the Return key.

Out[7]=

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
RemoveChannelListener[listener]
Out[8]=

Related Examples

de es fr ja ko pt-br ru zh