Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/.doctrees/about.doctree
Binary file not shown.
Binary file modified docs/.doctrees/auth.doctree
Binary file not shown.
Binary file modified docs/.doctrees/basic_usage.doctree
Binary file not shown.
Binary file modified docs/.doctrees/changelog.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/faq.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/metadata.doctree
Binary file not shown.
Binary file modified docs/.doctrees/real_time_messaging.doctree
Binary file not shown.
19 changes: 19 additions & 0 deletions docs/_sources/basic_usage.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ There are some unique options specific to sending IMs, so be sure to read the **
section of the `chat.postMessage <https://api.slack.com/methods/chat.postMessage#channels>`_
page for a full list of formatting and authorship options.

Sending an ephemeral message, which is only visible to an assigned user in a specified channel, is nearly the same
as sending a regular message, but with an additional ``user`` parameter.

.. code-block:: python

from slackclient import SlackClient

slack_token = os.environ["SLACK_API_TOKEN"]
sc = SlackClient(slack_token)

sc.api_call(
"chat.postEphemeral",
channel="#python",
text="Hello from Python! :tada:",
user="U0XXXXXXX"
)

See `chat.postEphemeral <https://api.slack.com/methods/chat.postEphemeral>`_ for more info.

--------

Replying to messages and creating threads
Expand Down
12 changes: 3 additions & 9 deletions docs/_sources/faq.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,12 @@ How do I compile the documentation?
***********************************

This project's documentation is generated with `Sphinx <http://www.sphinx-doc.org>`_. If you are editing one of the many
reStructuredText files in the ``docs-src`` folder, you'll need to rebuild the documentation. First, install the project's
development dependencies (ideally using `virtualenv <https://virtualenv.pypa.io>`_.
reStructuredText files in the ``docs-src`` folder, you'll need to rebuild the documentation. It is recommended to run
the following steps inside a ``virtualenv`` environment.

.. code-block:: bash

pip install -r requirements.txt -r requirements-dev.text

Then run Sphinx.

.. code-block:: bash

sphinx-build -c ./docs-src/_themes/slack/ -b html docs-src docs
tox -e docs


Do be sure to add the ``docs`` folder and its contents to your pull request!
Expand Down
16 changes: 16 additions & 0 deletions docs/basic_usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ <h2>Sending a message<a class="headerlink" href="#sending-a-message" title="Perm
<p>There are some unique options specific to sending IMs, so be sure to read the <strong>channels</strong>
section of the <a class="reference external" href="https://api.slack.com/methods/chat.postMessage#channels">chat.postMessage</a>
page for a full list of formatting and authorship options.</p>
<p>Sending an ephemeral message, which is only visible to an assigned user in a specified channel, is nearly the same
as sending a regular message, but with an additional <code class="docutils literal"><span class="pre">user</span></code> parameter.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">slackclient</span> <span class="kn">import</span> <span class="n">SlackClient</span>

<span class="n">slack_token</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;SLACK_API_TOKEN&quot;</span><span class="p">]</span>
<span class="n">sc</span> <span class="o">=</span> <span class="n">SlackClient</span><span class="p">(</span><span class="n">slack_token</span><span class="p">)</span>

<span class="n">sc</span><span class="o">.</span><span class="n">api_call</span><span class="p">(</span>
<span class="s2">&quot;chat.postEphemeral&quot;</span><span class="p">,</span>
<span class="n">channel</span><span class="o">=</span><span class="s2">&quot;#python&quot;</span><span class="p">,</span>
<span class="n">text</span><span class="o">=</span><span class="s2">&quot;Hello from Python! :tada:&quot;</span><span class="p">,</span>
<span class="n">user</span><span class="o">=</span><span class="s2">&quot;U0XXXXXXX&quot;</span>
<span class="p">)</span>
</pre></div>
</div>
<p>See <a class="reference external" href="https://api.slack.com/methods/chat.postEphemeral">chat.postEphemeral</a> for more info.</p>
</div>
<hr class="docutils" />
<div class="section" id="replying-to-messages-and-creating-threads">
Expand Down
10 changes: 3 additions & 7 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,9 @@ <h2>I’d like to contribute…but how?<a class="headerlink" href="#i-d-like-to-
<div class="section" id="how-do-i-compile-the-documentation">
<h2>How do I compile the documentation?<a class="headerlink" href="#how-do-i-compile-the-documentation" title="Permalink to this headline">¶</a></h2>
<p>This project’s documentation is generated with <a class="reference external" href="http://www.sphinx-doc.org">Sphinx</a>. If you are editing one of the many
reStructuredText files in the <code class="docutils literal"><span class="pre">docs-src</span></code> folder, you’ll need to rebuild the documentation. First, install the project’s
development dependencies (ideally using <a class="reference external" href="https://virtualenv.pypa.io">virtualenv</a>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>pip install -r requirements.txt -r requirements-dev.text
</pre></div>
</div>
<p>Then run Sphinx.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>sphinx-build -c ./docs-src/_themes/slack/ -b html docs-src docs
reStructuredText files in the <code class="docutils literal"><span class="pre">docs-src</span></code> folder, you’ll need to rebuild the documentation. It is recommended to run
the following steps inside a <code class="docutils literal"><span class="pre">virtualenv</span></code> environment.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>tox -e docs
</pre></div>
</div>
<p>Do be sure to add the <code class="docutils literal"><span class="pre">docs</span></code> folder and its contents to your pull request!</p>
Expand Down
Loading