Why is my webhook not working?

I created a working webhook using LukeGabriel’s tutorial.

Tutorial here

How-To: Send Webhooks from ROBLOX to Slack to Discord! - YouTube

The script relies on a module like this:

local HTTP = game:GetService("HttpService")
local URL = "https://www.roblox.com/library/763250..."

local BOTModule = {}

function BOTModule:SendMessage(Message)
	local SlackMessage = HTTP:JSONEncode({
		text = ""..Message..""
	HTTP:PostAsync(URL, SlackMessage)

return BOTModule

Everything works fine so far.
Here I already get the error:

		local SS = game.ServerStorage
		local BOTModule = require(SS.BOTModule)
		BOTModule:SendMessage("Pressed button")

The script is part of the local script and its task is to retrieve data from TextBox and then import it into the BOTmodule.

On the console this pops up:

07:51:10.301 BOTModule is not a valid member of ServerStorage “ServerStorage” - Client - LocalScript:73

I’ve tried everything from writing to the tutorial creator to writing this script in local script.
Pls help

You’re using a LocalScript to access a ServerService, use a Remote instead to communicate between the Client and Server. Anything that says “Server” cannot be accessed by the Client at all (Unless using a Remote).

To assist you further on how you can access the server via Client then follow these steps.

First create a Remote in a ClientService, for example: ReplicatedStorage.

Then in the LocalScript remove ‘local SS = game.ServerStorage’ and ‘local BOTModule = requireblahblah’ and instead replace with ‘local remote = thepathwherethatremoteis’

Thirdly fire that remote to the server, so ‘remote:FireServer(‘mymessage’)’

Fourth, create a ServerScript in ServerScriptService and grab the same remote. ‘local remote = blahlabhaj’ then require that BOTModule and then create a listener, so. ‘remote.OnServerEvent:Connect(function(plr,msg) BOTModule:SendMessage(msg) end)’

Remember the first parameter is always the player, keep that in-mind.

If you’ve any other questions, please reply.

It doesn’t work.I re-scripted some things.
Script when u press a button:

		local text = script.Parent.Pc.Screen.Rejestracja.WiekBox

Script in ServerScriptService:

	local SS = game:GetService("ServerStorage")
	local BOTModule = require(SS.BOTModule)



And this error pops up

08:06:09.328 ServerStorage.BOTModule:10: attempt to concatenate Instance with string - Server - BOTModule:10

WiekBox.Text, always need to add .Text to define you’re grabbing the Text from the TextBox.

Please also understand that your Discord Account can potentially be banned if you send too many messages from Roblox-To-Discord. Keep that in mind :slight_smile:

It didn’t work either.
I don’t know what can be wrong in this script.

Detected another problem, in the listener you have only (text) it must be (plr, text) because the first parameter while listening on the Server for the remote to be fired it will always be the player first.

If it worked lmk so I know your problem has been solved :slight_smile:

It didn’t work.
Script 1:

		local text = script.Parent.Pc.Screen.Rejestracja.WiekBox.Text
		local player = game.Players.LocalPlayer
		game.ReplicatedStorage.RemoteEvent:FireServer(player, text)

Script 2:

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, text)
	local SS = game:GetService("ServerStorage")
	local BOTModule = require(SS.BOTModule)


Noooo, you don’t need to add player to the FireServer() it adds it automatically, only add it on the Listener.