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
{{ message }}
This repository was archived by the owner on Aug 15, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,5 +89,18 @@ Plugins can also run methods on a schedule. This allows a plugin to poll for upd
89
89
####Plugin misc
90
90
The data within a plugin persists for the life of the rtmbot process. If you need persistent data, you should use something like sqlite or the python pickle libraries.
91
91
92
+
####Direct API Calls
93
+
You can directly call the Slack web API in your plugins by including the following import:
94
+
95
+
from client import slack_client
96
+
97
+
You can also rename the client on import so it can be easily referenced like shown below:
98
+
99
+
from client import slack_client as sc
100
+
101
+
Direct API calls can be called in your plugins in the following form:
102
+
103
+
sc.api_call("API.method", "parameters")
104
+
92
105
####Todo:
93
106
Some rtm data should be handled upstream, such as channel and user creation. These should create the proper objects on-the-fly.
0 commit comments