You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/slave-channel.md
+7
Original file line number
Diff line number
Diff line change
@@ -83,3 +83,10 @@ Each `dict` item should have:
83
83
### `get_group_members(self, group_uid)`
84
84
85
85
> TODO: Documentation for `get_group_members`
86
+
87
+
## Command message
88
+
Slave channels can send messages that offer the user options to take action. This can be used in situations such as friend request, fund transfer and Telegram Inline Buttons.
89
+
90
+
Aside from sending a message with "Command" type (refer to the specification in "Message" documentation), the slave channel have to also provide a method for the command to be issued.
91
+
92
+
The method can take any argument of Python's standard data structure, and returns a string which is shown to the user as the result of the action.
Copy file name to clipboardExpand all lines: docs/workflow.md
+6-1
Original file line number
Diff line number
Diff line change
@@ -41,4 +41,9 @@ To deliver user's message to a slave channel, you should first gather all the in
41
41
## Slave Channel
42
42
Slave channel has rather less things to do, get and enqueue incoming message, and send message to the platform. Also you may need to generate a list of possible recipients for the Master channel. That should be most of it.
43
43
44
-
> In the future, I may also come out with a protocol for command delivery. This includes some common ones like adding or accepting new contacts to slave channel, or even customizable ones. See when can I finish it. :P
44
+
# Commands
45
+
Once there's any message from a slave channel that allows the user to take action, the slave channel will enclose detail of actions (namely method names and arguments) into an `EFBMsg` object and send it to the master channel.
46
+
47
+
Master channel will use it's own method to ask the user to make a decision, and with the decision, the master channel will call the respective method of the slave channel with the argument given.
48
+
49
+
The method of slave channel returns a string as the result which is then reflected back to the user.
0 commit comments