简体   繁体   English

如何在Slack上集成python Bot?

[英]How to integrate python bot on slack?

I have written a bot for slack channel using python. 我已经写了使用python松弛通道僵尸。 now each time I need to open a command prompt and run python3 filename.py to run the functionality. 现在,每次我需要打开命令提示符并运行python3 filename.py来运行该功能时。

Is there any way so that I can integrate it with slack channel? 有什么办法可以将其与松弛通道集成吗? this command will run once a day basis. 该命令将每天运行一次。

You need to use the slack API and Slack's Bot User to integrate your code with Slack. 您需要使用slack API和Slack的Bot用户将代码与Slack集成在一起。 Using the slack event, you can fetch the channel ID and where your slack bot will respond or accept messages from. 使用slack事件,您可以获取频道ID以及您的slack僵尸程序将在其中响应或接受消息的位置。 For this is it better that you create an application, maybe a Flask app, that keeps running on your server, listening for activity. 因为这是它更好的,你创建一个应用程序,可能是瓶的应用程序,,让您的服务器上运行,监听活动。 Here is a repo that does pretty much that https://github.com/slackapi/Slack-Python-Onboarding-Tutorial 这是一个可以完成https://github.com/slackapi/Slack-Python-Onboarding-Tutorial的仓库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM