在线程中响应松弛工作流程帖子

发布于 2025-01-15 18:57:36 字数 1262 浏览 4 评论 0原文

我的目标是让我的机器人在线程中响应频道中的工作流程帖子。响应将基于工作流程帖子中的内容。例如,工作流程帖子将包含主题:画布数据,机器人将在线程中响应。这是我当前的机器人脚本,

from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler

token = config("KEY")
app_token = config("App_Token")
app =App(token=token)

@app.message("Topic: Canvas Data")
def something(message, say):
    channel = message["channel"]
    thread_ts = message["ts"]
    text = "Hey! Here are some Canvas Data resources you can send to the client. \n \n• <https://impl.instructuremedia.com/embed/4f3edf4a-4d61-4b70-8279-963af90b207d|Canvas Data Video Overview>  \n• <https://community.canvaslms.com/t5/Canvas-Data-Users/Canvas-Data-FAQ/ta-p/251184|Canvas Data FAQ> \n• <https://community.canvaslms.com/t5/Admin-Guide/How-do-I-use-the-Canvas-Data-Portal-for-an-account/ta-p/261|How do I use the Canvas Data Portal for an account> \n• <https://community.canvaslms.com/t5/Admin-Guide/tkb-p/admin#CanvasDataServices|Canvas Data Services Guides>"
    say(text=text, channel=channel, thread_ts=thread_ts)



def main():
   handler = SocketModeHandler(app, app_token)
   handler.start()

if __name__ == "__main__":
    main()

我查看了 slack 文档,我认为这是一个模式,但我不确定它是否是或如何对其做出响应。任何帮助将不胜感激。

My goal is to have my bot respond in thread to a workflow post in the channel. The response will be based on what is inside of the workflow post. For example, the workflow post will contain Topic:Canvas Data and the bot will respond in thread. Here is my current bot script

from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler

token = config("KEY")
app_token = config("App_Token")
app =App(token=token)

@app.message("Topic: Canvas Data")
def something(message, say):
    channel = message["channel"]
    thread_ts = message["ts"]
    text = "Hey! Here are some Canvas Data resources you can send to the client. \n \n• <https://impl.instructuremedia.com/embed/4f3edf4a-4d61-4b70-8279-963af90b207d|Canvas Data Video Overview>  \n• <https://community.canvaslms.com/t5/Canvas-Data-Users/Canvas-Data-FAQ/ta-p/251184|Canvas Data FAQ> \n• <https://community.canvaslms.com/t5/Admin-Guide/How-do-I-use-the-Canvas-Data-Portal-for-an-account/ta-p/261|How do I use the Canvas Data Portal for an account> \n• <https://community.canvaslms.com/t5/Admin-Guide/tkb-p/admin#CanvasDataServices|Canvas Data Services Guides>"
    say(text=text, channel=channel, thread_ts=thread_ts)



def main():
   handler = SocketModeHandler(app, app_token)
   handler.start()

if __name__ == "__main__":
    main()

I have looked at the slack documenation and I think this is a modal but I am not sure if it is or how to make a response to it. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文