Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Commit 14442f3

Browse files
authored
Merge pull request #58 from jammons/philipyun103-master
Cleaning up the example plugin for using the Web API in a plugin
2 parents a4641c8 + 5e7daff commit 14442f3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from __future__ import unicode_literals
22
from client import slack_client as sc
33

4-
for user in sc.api_call("users.list")["members"]:
5-
print(user["name"], user["id"])
4+
5+
def process_message(data):
6+
'''If a user passes 'print users' in a message, print the users in the slack
7+
team to the console. (Don't run this in production probably)'''
8+
9+
if 'print users' in data['text']:
10+
for user in sc.api_call("users.list")["members"]:
11+
print(user["name"], user["id"])

0 commit comments

Comments
 (0)