Add support for "sub apps"
還沒有人認領這個 Issue。
評估
研究方向
先檢視 slack_bolt.App 和 slack_bolt.async_app.AsyncApp 的組合 API,接著閱讀 issue #236 中描述的 workaround。將要求的 add_app 行為與 FastAPI 的 include_router 及 Typer 的 add_typer 進行比較。當獨立定義的子應用程式或 plugin 可以附加至兩種 app 變體,而不必手動傳遞父 app 或直接呼叫 decorator 時,工作即完成。
由索引模型根據 Issue 內容生成。
描述
When creating a large slack application it would be nice to be able to reuse components in a more pythonic way than what is possible right now.
A workaround is described in issue #236, but it requires passing the app object around and manually wiring up things by registering and calling decorators as functions directly.
I suggest adding a feature much like include_router in FastAPI or add_typer in Typer.
This feature will let us create sub-apps in separate files or even separate packages, like plugins that can be published on pypi.org separately.
Here is a small example illustrating what I mean:
main.py
Here is our main app, where we add a plugin from a separate package
import os
from slack_bolt import App
from my_plugin import my_plugin
# Initializes your app with your bot token and signing secret
app = App(
token=os.environ.get("SLACK_BOT_TOKEN"),
signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
)
app.add_app(my_plugin)
my_plugin.py
A simple plugin that just creates a slack_bolt app, but without any config
from slack_bolt import App
my_plugin = App()
@my_plugin.message("hello")
def message_hello(message, say):
say("Hello world")
Category
- slack_bolt.App and/or its core components
- slack_bolt.async_app.AsyncApp and/or its core components
- Adapters in slack_bolt.adapter
- Others
- 主要語言
- Python
- 星號
- 1.3k
- 分支
- 291
- 平均合併
- 1 天 14 小時
- 30 天內合併 PR
- 8
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
slackapi/bolt-python 的其他 Issue
-
docs enhancement server-side
難度 1/5 1 小時以內 新手友好度 88/100
slackapi/bolt-python#1576 · 1 則留言 ·
-
auto-triage-skip bug security semver:major
難度 2/5 1-3 小時 新手友好度 72/100
slackapi/bolt-python#1447 · 9 則留言 ·
-
難度 3/5 1-2 天 新手友好度 65/100
slackapi/bolt-python#1577 ·
-
area:async auto-triage-skip dependencies
難度 3/5 1-2 天 新手友好度 65/100
slackapi/bolt-python#1472 · 1 則留言 · 1 個 reaction ·
-
Enhancement: Assistant should inherit global middleware for security and consistency可能重新可做 @hello-ashleyintech 於 423 天前認領,目前沒有進行中的 PR。 未關閉auto-triage-skip enhancement
slackapi/bolt-python#1346 · 2 則留言 · 已指派 1 人 ·
查看 slackapi/bolt-python 的全部 Issue
相似的 Issue
-
deployment release-lag
難度 2/5 1-3 小時 新手友好度 68/100
nolte/kamerplanter#2047 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
NousResearch/hermes-plugin-claude-subscription-directsdk#94 ·
維護者通常 1 天內回覆
-
namespace operations
難度 2/5 1-3 小時 新手友好度 72/100
EclipseFdn/open-vsx.org#13702 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆