![]() It allows you to keep your applications running forever, reloads them without downtime, helps in the administration of your application's logs, and much more.įirst, you'll need to have Node.js and npm (Node Package Manager) installed on your system. PM2 is a powerful, feature-rich process manager in Node.js. Running the Script in Production with PM2 Your bot should now be ready to respond to the /chatgpt command. In your Python code, replace SLACK_BOT_TOKEN, SLACK_APP_TOKEN and OPENAI_API_KEY with your actual tokens.įinally, go to your Slack workspace and invite your bot to a channel by adding him from the Integrations tab. Fill out the rest of the form and click "Save". You'll need these for your Python code.Ĭlick on "Slash Commands" in the sidebar, then "Create New Command". Copy the "Bot User OAuth Token" (it should start with "xoxb-") and the "App Level Token" (it should start with "xapp-"). Here, you'll see a section for "Tokens for Your Workspace". Follow the prompts to authorize the bot in your workspace.Īfter installing the app, you'll be redirected back to the "OAuth & Permissions" page. ![]() Navigate back to "OAuth & Permissions" and click "Install App to Workspace". Copy the "App Level Token" (it starts with "xapp-"). This will allow your app to use the Socket Mode, which allows your app to receive events directly via a WebSocket connection. Go to the "Socket Mode" section and enable it. memberjoinedchannel: A user joined a public or private channel. ![]() teamjoin: A new member has joined the team. Slack provides at least 50 different event types, such as: message: A message was sent to a channel. To read and write messages, you'll need the following scopes at a minimum: A Slack Bots job is to receive and handle events generated by your teams Slack interaction. Here you need to add the required scopes for your bot. Navigate to "OAuth & Permissions" in the sidebar, then scroll down to "Bot Token Scopes". Cool right If you use Slack already, you should be familiar with some creative Slack bots like Standupbot, Birthdaybot and more. Your bot can send DMs, it can be mentioned by users, it can post messages or upload files, and it can be invited to channels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |