Skip to content

Commit

Permalink
version 1.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Oct 18, 2022
1 parent 31146a2 commit 1a3ff44
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 20 deletions.
18 changes: 18 additions & 0 deletions docs/api-docs/slack_bolt/async_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -3868,9 +3868,18 @@ <h3>Class variables</h3>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; AsyncSlackResponse:
if _can_say(self, channel):
Expand All @@ -3882,9 +3891,18 @@ <h3>Class variables</h3>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down
38 changes: 38 additions & 0 deletions docs/api-docs/slack_bolt/context/say/async_say.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ <h1 class="title">Module <code>slack_bolt.context.say.async_say</code></h1>
</summary>
<pre><code class="python">from typing import Optional, Union, Dict, Sequence

from slack_sdk.models.metadata import Metadata

from slack_bolt.context.say.internals import _can_say
from slack_bolt.util.utils import create_copy
from slack_sdk.models.attachments import Attachment
Expand All @@ -54,9 +56,18 @@ <h1 class="title">Module <code>slack_bolt.context.say.async_say</code></h1>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; AsyncSlackResponse:
if _can_say(self, channel):
Expand All @@ -68,9 +79,18 @@ <h1 class="title">Module <code>slack_bolt.context.say.async_say</code></h1>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down Expand Up @@ -121,9 +141,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; AsyncSlackResponse:
if _can_say(self, channel):
Expand All @@ -135,9 +164,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down
18 changes: 18 additions & 0 deletions docs/api-docs/slack_bolt/context/say/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; SlackResponse:
if _can_say(self, channel):
Expand All @@ -100,9 +109,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down
37 changes: 37 additions & 0 deletions docs/api-docs/slack_bolt/context/say/say.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h1 class="title">Module <code>slack_bolt.context.say.say</code></h1>
from slack_sdk import WebClient
from slack_sdk.models.attachments import Attachment
from slack_sdk.models.blocks import Block
from slack_sdk.models.metadata import Metadata
from slack_sdk.web import SlackResponse

from slack_bolt.context.say.internals import _can_say
Expand All @@ -55,9 +56,18 @@ <h1 class="title">Module <code>slack_bolt.context.say.say</code></h1>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; SlackResponse:
if _can_say(self, channel):
Expand All @@ -69,9 +79,18 @@ <h1 class="title">Module <code>slack_bolt.context.say.say</code></h1>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down Expand Up @@ -122,9 +141,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; SlackResponse:
if _can_say(self, channel):
Expand All @@ -136,9 +164,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down
18 changes: 18 additions & 0 deletions docs/api-docs/slack_bolt/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4131,9 +4131,18 @@ <h3>Class variables</h3>
blocks: Optional[Sequence[Union[Dict, Block]]] = None,
attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
channel: Optional[str] = None,
as_user: Optional[bool] = None,
thread_ts: Optional[str] = None,
reply_broadcast: Optional[bool] = None,
unfurl_links: Optional[bool] = None,
unfurl_media: Optional[bool] = None,
icon_emoji: Optional[str] = None,
icon_url: Optional[str] = None,
username: Optional[str] = None,
mrkdwn: Optional[bool] = None,
link_names: Optional[bool] = None,
parse: Optional[str] = None, # none, full
metadata: Optional[Union[Dict, Metadata]] = None,
**kwargs,
) -&gt; SlackResponse:
if _can_say(self, channel):
Expand All @@ -4145,9 +4154,18 @@ <h3>Class variables</h3>
text=text,
blocks=blocks,
attachments=attachments,
as_user=as_user,
thread_ts=thread_ts,
reply_broadcast=reply_broadcast,
unfurl_links=unfurl_links,
unfurl_media=unfurl_media,
icon_emoji=icon_emoji,
icon_url=icon_url,
username=username,
mrkdwn=mrkdwn,
link_names=link_names,
parse=parse,
metadata=metadata,
**kwargs,
)
elif isinstance(text_or_whole_response, dict):
Expand Down
48 changes: 30 additions & 18 deletions docs/api-docs/slack_bolt/request/internals.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ <h1 class="title">Module <code>slack_bolt.request.internals</code></h1>


def extract_enterprise_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;enterprise&#34;) is not None:
org = payload.get(&#34;enterprise&#34;)
org = payload.get(&#34;enterprise&#34;)
if org is not None:
if isinstance(org, str):
return org
elif &#34;id&#34; in org:
return org.get(&#34;id&#34;) # type: ignore
return org.get(&#34;id&#34;)
if payload.get(&#34;authorizations&#34;) is not None and len(payload[&#34;authorizations&#34;]) &gt; 0:
# To make Events API handling functioning also for shared channels,
# we should use .authorizations[0].enterprise_id over .enterprise_id
Expand Down Expand Up @@ -131,26 +131,32 @@ <h1 class="title">Module <code>slack_bolt.request.internals</code></h1>


def extract_user_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;user&#34;) is not None:
user = payload.get(&#34;user&#34;)
user = payload.get(&#34;user&#34;)
if user is not None:
if isinstance(user, str):
return user
elif &#34;id&#34; in user:
return user.get(&#34;id&#34;) # type: ignore
return user.get(&#34;id&#34;)
if &#34;user_id&#34; in payload:
return payload.get(&#34;user_id&#34;)
if payload.get(&#34;event&#34;) is not None:
return extract_user_id(payload[&#34;event&#34;])
if payload.get(&#34;message&#34;) is not None:
# message_changed: body[&#34;event&#34;][&#34;message&#34;]
return extract_user_id(payload[&#34;message&#34;])
if payload.get(&#34;previous_message&#34;) is not None:
# message_deleted: body[&#34;event&#34;][&#34;previous_message&#34;]
return extract_user_id(payload[&#34;previous_message&#34;])
return None


def extract_channel_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;channel&#34;) is not None:
channel = payload.get(&#34;channel&#34;)
channel = payload.get(&#34;channel&#34;)
if channel is not None:
if isinstance(channel, str):
return channel
elif &#34;id&#34; in channel:
return channel.get(&#34;id&#34;) # type: ignore
return channel.get(&#34;id&#34;)
if &#34;channel_id&#34; in payload:
return payload.get(&#34;channel_id&#34;)
if payload.get(&#34;event&#34;) is not None:
Expand Down Expand Up @@ -327,12 +333,12 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<span>Expand source code</span>
</summary>
<pre><code class="python">def extract_channel_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;channel&#34;) is not None:
channel = payload.get(&#34;channel&#34;)
channel = payload.get(&#34;channel&#34;)
if channel is not None:
if isinstance(channel, str):
return channel
elif &#34;id&#34; in channel:
return channel.get(&#34;id&#34;) # type: ignore
return channel.get(&#34;id&#34;)
if &#34;channel_id&#34; in payload:
return payload.get(&#34;channel_id&#34;)
if payload.get(&#34;event&#34;) is not None:
Expand Down Expand Up @@ -369,12 +375,12 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<span>Expand source code</span>
</summary>
<pre><code class="python">def extract_enterprise_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;enterprise&#34;) is not None:
org = payload.get(&#34;enterprise&#34;)
org = payload.get(&#34;enterprise&#34;)
if org is not None:
if isinstance(org, str):
return org
elif &#34;id&#34; in org:
return org.get(&#34;id&#34;) # type: ignore
return org.get(&#34;id&#34;)
if payload.get(&#34;authorizations&#34;) is not None and len(payload[&#34;authorizations&#34;]) &gt; 0:
# To make Events API handling functioning also for shared channels,
# we should use .authorizations[0].enterprise_id over .enterprise_id
Expand Down Expand Up @@ -458,16 +464,22 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<span>Expand source code</span>
</summary>
<pre><code class="python">def extract_user_id(payload: Dict[str, Any]) -&gt; Optional[str]:
if payload.get(&#34;user&#34;) is not None:
user = payload.get(&#34;user&#34;)
user = payload.get(&#34;user&#34;)
if user is not None:
if isinstance(user, str):
return user
elif &#34;id&#34; in user:
return user.get(&#34;id&#34;) # type: ignore
return user.get(&#34;id&#34;)
if &#34;user_id&#34; in payload:
return payload.get(&#34;user_id&#34;)
if payload.get(&#34;event&#34;) is not None:
return extract_user_id(payload[&#34;event&#34;])
if payload.get(&#34;message&#34;) is not None:
# message_changed: body[&#34;event&#34;][&#34;message&#34;]
return extract_user_id(payload[&#34;message&#34;])
if payload.get(&#34;previous_message&#34;) is not None:
# message_deleted: body[&#34;event&#34;][&#34;previous_message&#34;]
return extract_user_id(payload[&#34;previous_message&#34;])
return None</code></pre>
</details>
</dd>
Expand Down
Loading

0 comments on commit 1a3ff44

Please sign in to comment.