Skip to content

Commit

Permalink
Fix a minor error in RTM document
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed May 28, 2021
1 parent ef81a8d commit 1fddbff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs-src/real_time_messaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Below is a code snippet that uses the legacy version of ``RTMClient``. For new a
rtm_client = RTMClient(token=slack_token)
rtm_client.start()
**rtm.start vs rtm.connect**
**rtm.start vs rtm.connect (v1 client)**

By default, the RTM client uses ``rtm.connect`` to establish a WebSocket connection with Slack. The response contains basic information about the team and WebSocket url.

Expand All @@ -91,7 +91,7 @@ If you'd rather use ``rtm.start`` to establish the connection, which provides mo
.. code-block:: python
import os
from slack_sdk import RTMClient
from slack_sdk.rtm import RTMClient
@RTMClient.run_on(event="message")
def say_hello(**payload):
Expand Down
4 changes: 2 additions & 2 deletions docs/real_time_messaging.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ <h2>Real Time Messaging (RTM)<a class="headerlink" href="#real-time-messaging-rt
<span class="n">rtm_client</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
</pre></div>
</div>
<p><strong>rtm.start vs rtm.connect</strong></p>
<p><strong>rtm.start vs rtm.connect (v1 client)</strong></p>
<p>By default, the RTM client uses <code class="docutils literal notranslate"><span class="pre">rtm.connect</span></code> to establish a WebSocket connection with Slack. The response contains basic information about the team and WebSocket url.</p>
<p>If you’d rather use <code class="docutils literal notranslate"><span class="pre">rtm.start</span></code> to establish the connection, which provides more information about the conversations and users on the team, you can set the <code class="docutils literal notranslate"><span class="pre">connect_method</span></code> option to <code class="docutils literal notranslate"><span class="pre">rtm.start</span></code> when instantiating the RTM Client. Note that on larger teams, use of <code class="docutils literal notranslate"><span class="pre">rtm.start</span></code> can be slow and unreliable.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">slack_sdk</span> <span class="kn">import</span> <span class="n">RTMClient</span>
<span class="kn">from</span> <span class="nn">slack_sdk.rtm</span> <span class="kn">import</span> <span class="n">RTMClient</span>

<span class="nd">@RTMClient</span><span class="o">.</span><span class="n">run_on</span><span class="p">(</span><span class="n">event</span><span class="o">=</span><span class="s2">&quot;message&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">say_hello</span><span class="p">(</span><span class="o">**</span><span class="n">payload</span><span class="p">):</span>
Expand Down

0 comments on commit 1fddbff

Please sign in to comment.