To do soĬlick on the OAuth & Permissions section to Install App to Workspace which will prompt you to authorizeĪccess and generate the tokens you’ll use. We’ll need to generate an OAuth token for our user in order to actually connect with the Slack API. Will be visible to all users within the workspace once mounted. Here we’ll need to createĪ Bot User that will act as our listener within the workspace. Once done you’ll be presented with a number of options for your new application. Here I’ve created the NHL Scores app within my workspace. Navigate to theĪpp registration tool to create a new application within your ( RTM) and specifically the chat.postMessage and chat.postEphemeralīefore any of our code is working we’ll need to set up an app within slack itself. Your bot to address, but in our case here we’ll look at using the Real Time Messaging API There are a number of calls you can develop Payloads to anticipate for any particular object. The Slack API is well flushed out and spells out what specific In my case here I’m developing on my laptop but You’ll either need to set up an ngrok listener for your chosen localhost port, or develop on a server the excellent golang slack library from nlopes –.NHL statsapi to collect hockey scores –. Here I’ll be using Fedora 26 (4.14.86_64) along with these tools: Reader to take a look at the installation practices for the other software dependencies based on their Opportunity to implement my first Slack bot and figured I would document the process for others! YouĬan find all of the code for this post listed here,įor this assignment we’ll need a few things, not all of which are covered in this post. I’ve been an IRC user for many years and always loved setting upīots, whether for sports scores, weather, or something else entirely. In this post we’ll look at how to set up a quick Slack bot that receives messages (either direct orįrom channel) and replies to the user. Create a Slack bot with golang Introduction
0 Comments
Leave a Reply. |