gder.blogg.se

What is a slackbot
What is a slackbot




When a message containing keywords is sent to the chat, the app (bot) responds. message ( '残業' ) def delete_zangyo ( message, say ): channel = message timestamp = message user_client. In Terminal, create and navigate to the working app. The Bot User OAuth Token (starting with xoxb-) and the User OAuth Token (starting with xoxp- ) that appear afterwards will be copied for future use. Enter the name of your bot in "Display Name (Bot Name)" and enter your username in "Default username" with alphanumeric characters only (not sure what the username is used for.).Ĭlick Install App in the left side menu bar, click Install to Workspace, and then click Allow. Once added, click Save Changes to save the changes.Ĭlick "App Home" in the left side menu bar, and then click "Edit" in "App Display Name". Turn on "Enable Events" in "Event Subscriptions" in the left side menu bar, click "Add Bot User Event" in "Subscribe to bot events", and add message.channels. The APP_TOKEN (starting with xapp-) that appear after that will be copied for future use.Ĭlick "Socket Mode" in the left side menu bar and turn on "Enable Socket Mode". Initialize the application for bot and install it in Slack.Ĭlick "OAuth & Permissions" in the left side menu bar and add chat:write, reactions:write and channels:history to "Bot Token Scopes" in "Scopes" as follows (you don't need to add them here because "channels:history" will be added automatically later).Īlso add the following chat:write to "User Token Scopes" in "Scopes".Īdd the following connections:write to "App-Level Tokens" in "Basic Information" in the left side menu bar. A method that allows you to react (add emoji stickers) to chats on Slack.Ĭreate a new app from the URL above, enter the app name, and select the workspace to deploy. This time, we will use "Web API methods" to expand the functions of SlackBot.Ĭhat_delete . Methods that allow you to erase chats on Slack. So, let's work on making a fun and entertaining bot What to use primarily I will explain carefully from 1, so please rest assured even if you are a beginner! The bot we will create this time is a bot that will delete when a negative word is written in the chat, and conversely, when a positive word is written, it will convey gratitude with a reactionĬreate this SlackBot and say goodbye from the uncomfortable chat! Thanks for the pleasant chat! And get a peaceful Slack






What is a slackbot