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
Before contributing, please read our [Code of Conduct](./CODE_OF_CONDUCT.md). We take it very seriously, and expect that you will as well.
8
+
9
+
## New Issues
10
+
11
+
Before opening a new issue, please consider:
12
+
13
+
- Reading [the documentation](https://github.com/slackhq/SlackTextViewController/blob/master/README.md) and [the changelog](https://github.com/slackhq/SlackTextViewController/blob/master/README.md) first.
14
+
- Searching for any related issues and avoid creating duplicated issues.
15
+
- Adding details, diagnoses, screenshots or any type of useful information in existing issues, even if they are marked as closed. The team will still review it.
16
+
- Trying out the examples [provided in this repository](https://github.com/slackhq/SlackTextViewController/tree/master/examples).
17
+
- Taking the time to think of a solution and [**open a pull request**](#new-pull-requests) for either improving the documentation, fixing a bug or suggesting a feature.
18
+
- Finally, **[open an issue]**(https://github.com/slackhq/SlackTextViewController/issues/new) to report a bug, ask for help or suggest a feature. The more information you give, the better people can help you.
19
+
20
+
21
+
## New Pull Requests
22
+
23
+
We love pull requests and we are generally very receptive to contributions. Things to keep in mind:
24
+
25
+
-[Fork the repository](https://github.com/slackhq/SlackTextViewController) and make sure to work on a branch up to date with origin master.
26
+
- Do your thing!
27
+
- Be mindful about doing atomic commits, adding documentation to your changes, not refactoring too much.
28
+
- Add tests covering the new code or functionality you are adding.
29
+
- Add a descriptive title and add any useful information for the reviewer. If your contribution is a user facing thing, please attach a screenshot and/or screencast (gif preferrably).
30
+
- Read and agree to our [Contributor License Agreement (CLA)](https://docs.google.com/a/slack-corp.com/forms/d/1q_w8rlJG_x_xJOoSUMNl7R35rkpA7N6pUkKhfHHMD9c/viewform). _We cannot accept your PR without your agreement to our CLA_.
31
+
- Create your pull request (yay!). If it is in relation to an existing issue, please mention it on the title or description.
32
+
33
+
[Interested in knowing more about about pull requests at Slack?](https://slack.engineering/on-empathy-pull-requests-979e4257d158#.awxtvmb2z)
*[ ] I've read and understood the [Contributing guidelines](./CONTRIBUTING.md) and have done my best effort to follow them.
2
+
*[ ] I've read and agree to the [Code of Conduct](./CODE_OF_CONDUCT.md).
3
+
*[ ] I've been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much.
4
+
*[ ] I've a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferrably).
5
+
*[ ] I've written tests to cover the new code and functionality included in this PR.
6
+
*[ ] I've read, agree to, and signed the [Contributor License Agreement (CLA)](https://docs.google.com/a/slack-corp.com/forms/d/1q_w8rlJG_x_xJOoSUMNl7R35rkpA7N6pUkKhfHHMD9c/viewform).
Diversity and inclusion make our community strong. We encourage participation from the most varied and diverse backgrounds possible and want to be very clear about where we stand.
6
+
7
+
Our goal is to maintain a safe, helpful and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic.
8
+
9
+
This code and related procedures also apply to unacceptable behavior occurring outside the scope of community activities, in all community venues (online and in-person) as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members.
10
+
11
+
## Expected Behavior
12
+
* Be welcoming.
13
+
* Be kind.
14
+
* Look out for each other.
15
+
16
+
## Unacceptable Behavior
17
+
* Conduct or speech which might be considered sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory or offensive in nature.
18
+
* Unwelcome, suggestive, derogatory or inappropriate nicknames or terms.
19
+
* Disrespect towards others. (Jokes, innuendo, dismissive attitudes.)
20
+
* Intimidation or harassment (online or in-person). Please read the [Citizen Code of Conduct](http://citizencodeofconduct.org/) for how we interpret harassment.
21
+
* Disrespect towards differences of opinion.
22
+
* Inappropriate attention or contact. Be aware of how your actions affect others. If it makes someone uncomfortable, stop.
23
+
* Not understanding the differences between constructive criticism and disparagement.
24
+
* Sustained disruptions.
25
+
* Violence, threats of violence or violent language.
26
+
27
+
## Enforcement
28
+
Understand that speech and actions have consequences, and unacceptable behavior will not be tolerated.
29
+
30
+
If you are the subject of, or witness to any violations of this Code of Conduct, please contact us by submitting a form [here](https://docs.google.com/a/slack-corp.com/forms/d/1NVqj2S2Q49XVIOT5N3L6Tx1oihvk9CpMa_UX8T_6ESo/viewform), or email conduct@slack.com.
31
+
32
+
If violations occur, organizers will take any action they deem appropriate for the infraction, up to and including expulsion.
33
+
34
+
_Thanks to the [Django Code of Conduct](https://www.djangoproject.com/conduct/), [The Citizen Code of Conduct](http://citizencodeofconduct.org/), [The Rust Code of Conduct](https://www.rust-lang.org/conduct.html) and [The Ada Initiative](http://adainitiative.org/2014/02/18/howto-design-a-code-of-conduct-for-your-community/)._
A basic client for Slack.com, which can optionally connect to the Slack Real Time Messaging (RTM) API.
8
9
10
+
Check out the [full documentation over here](http://python-slackclient.readthedocs.io/en/latest/?badge=latest)!
11
+
9
12
Overview
10
13
---------
11
14
This plugin is a light wrapper around the [Slack API](https://api.slack.com/). In its basic form, it can be used to call any API method and be expected to return a dict of the JSON reply.
12
15
13
16
The optional RTM connection allows you to create a persistent websocket connection, from which you can read events just like an official Slack client. This allows you to respond to events in real time without polling and send messages without making a full HTTPS request.
14
17
15
18
See [python-rtmbot](https://github.com/slackhq/python-rtmbot/) for an active project utilizing this library.
16
-
17
-
Installation
18
-
----------
19
-
20
-
#### Automatic w/ PyPI ([virtualenv](http://virtualenv.readthedocs.org/en/latest/) is recommended.)
"chat.postMessage", channel="#general", text="Hello from Python! :tada:",
46
-
username='pybot', icon_emoji=':robot_face:',
47
-
attachments=[{'title': 'This is an attachment', 'color': 'good'}]
48
-
)
49
-
```
50
-
51
-
### Real Time Messaging
52
-
---------
53
-
```python
54
-
import time
55
-
from slackclient import SlackClient
56
-
57
-
token ="xoxp-28192348123947234198234"# found at https://api.slack.com/web#authentication
58
-
sc = SlackClient(token)
59
-
if sc.rtm_connect():
60
-
whileTrue:
61
-
print sc.rtm_read()
62
-
time.sleep(1)
63
-
else:
64
-
print"Connection Failed, invalid token?"
65
-
```
66
-
67
-
####Objects
68
-
-----------
69
-
70
-
[SlackClient.**server**]
71
-
Server object owns the websocket and all nested channel information.
72
-
73
-
[SlackClient.server.**channels**]
74
-
A searchable list of all known channels within the parent server. Call `print (sc instance)` to see the entire list.
75
-
76
-
####Methods
77
-
-----------
78
-
79
-
| Method | Description |
80
-
| ----- | ----- |
81
-
| SlackClient.**rtm_connect()**| Connect to a Slack RTM websocket. This is a persistent connection from which you can read events. |
82
-
| SlackClient.**rtm_read()**| Read all data from the RTM websocket. Multiple events may be returned, always returns a list [], which is empty if there are no incoming messages. |
83
-
| SlackClient.**rtm_send_message([channel, message])**| Sends the text in [message] to [channel], which can be a name or identifier i.e. "#general" or "C182391" |
84
-
| SlackClient.**api_call([method])**| Call the Slack method [method]. Arguments can be passed as kwargs, for instance: sc.api_call('users.info', user='U0L85V3B4')_|
85
-
| SlackClient.server.**send_to_websocket([data])**| Send a JSON message directly to the websocket. See RTM documentation for allowed types.|
86
-
| SlackClient.server.**channels.find([identifier])**| The identifier can be either name or Slack channel ID. See above for examples. |
87
-
| SlackClient.server.**channels[int].send_message([text])**| Send message [text] to [int] channel in the channels list. |
88
-
| SlackClient.server.**channels.find([identifier]).send_message([text])**| Send message [text] to channel [identifier], which can be either channel name or ID. Ex "#general" or "C182391" |
0 commit comments