How to make ROBLOX communicate with my Discord Bot?

I know, I know there are multiple topics about this already but I’m still not sure and none of them answered my question

  1. What do you want to achieve? Communication with my Discord bot to see which player has joined

  2. What is the issue? I’m Not so sure on how to communicate with my bot

  3. What solutions have you tried so far? So far, I know that you have to create some sort of proxy server or website

LUA

-- local http = game:GetService("HttpService")
local url = "http://localhost:3000"
local data = http:GetAsync(url)

game.Players.PlayerAdded:Connect(function(plr)
	local success,err = pcall(function()
		http:PostAsync(url,plr,Enum.HttpContentType.ApplicationJson)
	end)
	if success then
		print("Success")
	else
		warn(err)
	end
end)

NODE.JS/DISCORD.JS

const express = require("express")
const app = express()

app.listen(3000, () => {
  console.log("listening to port 3000.")
})

app.post("/:guildid", (req, res) => {
  console.log("requested")
  
})

Any help is greatly appreciated. Thank you

1 Like