Hey! I have created a simple Slack API module that allows you to send Webhooks to your slack server. This will go through a step by step tutorial on creating your webhook then configuring it to the module. It is fairly simple so lets get started!
Go to https://api.slack.com/apps?new_app=1 and create and app, name it and choose a workspace!
Now lets make the web hook known as a webhook, click Incoming Webhooks
Enable the webhook my pressing the switch on the top right.
At the bottom press Add New Webhook to Workspace
Choose the channel you want to add the webhook to.
You should then get this message in the channel that you authorized the webhook in.
Insert the module inside of your game in ServerScriptService
Create a script in ServerScriptService and add the following code
local SlackAPI = require(game:GetService("ServerScriptService"):WaitForChild("SlackAPI"))
This code allows us to interact with our module!
Create the webhook integration
Let us look into our webhook links by going back to the page where we initially created our webhook. You should now see a new webhook there! Press Copy
I don’t exactly know the names for each individual part of the URL so I decided to make my own. this is what each one represents.
Now that we understand what each part of the URL stands for let us create the webhook, to do this the function is SlackAPI.new(id1, id2, id3) so our code would look like:
local SlackAPI = require(game:GetService("ServerScriptService"):WaitForChild("SlackAPI")) local Webhook = SlackAPI.new("TG1MF5V0D","BG2UHGD46","UAVmxDDjNKwypTUEapNaaZjc")
This is the last and easiest step of all! To send a webhook all you need to do is take the Webhook and use the :Send function so to send something like Hello! you just would use the code Webhook:Send(“Hello1”) and it would send! Your code should look like this:
local SlackAPI = require(game:GetService("ServerScriptService"):WaitForChild("SlackAPI")) local Webhook = SlackAPI.new("TG1MF5V0D","BG2UHGD46","UAVmxDDjNKwypTUEapNaaZjc") Webhook:Send("Hello!")
NOTE: All of the webhook data was erased on uploading this tutorial. Attempting to use the same data will result in errors.