Embeds | Roblox to Discord - Error due to different data types

Error with sending Embeds when using @Noah’s Discord to Roblox system using Heroku.

The issue is that the data array is being concatenated with the URL (string) which is therefore erroring due to being different data types.

1 Like

Can we see the logs you receive in roblox?

Thank you; can we see your script please?

Can you send it in a code tag please?

local Server_Url = "https://timberlinediscordlink.herokuapp.com/"
local Api_Key = "8e19eb33-b7a9-4fa1-8667-767d795f9c83"
local Complete_Url = Server_Url.. "discord"

local data = {
	["content"] = "",
	["embeds"] = {{
		["title"] = "__**Ultimate Title**__",
		["description"] = "blah blah",
		["type"] = "rich",
		["color"] = tonumber(0xffffff),
		["fields"] = {
			{
				["name"] = "__Title__",
				["value"] = "hi",
				["inline"] = true
			},
			{
				["name"] = "__Title__",
				["value"] = "hi",
				["inline"] = true
			}
		}
	}}
}

print(data)

local function SendDiscord(DscMsg)
	local Req_Url = Complete_Url .."?Key=" ..Api_Key.. "&Message=" ..DscMsg
	HttpsSerivce:GetAsync(Req_Url)
end


SendDiscord(data) --Send a message, customize by editing the string!

Remember to change your api key after this, you leaked it in the screenshot and text.

Few issues with this code, HttpsService is not defined, try changing data to string with the tostring() function, as shown below:

local HttpService = game:GetService("HttpService")

local Server_Url = "https://timberlinediscordlink.herokuapp.com/"
local Api_Key = "8e19eb33-b7a9-4fa1-8667-767d795f9c83"
local Complete_Url = Server_Url.. "discord"

local data = {
	["content"] = "",
	["embeds"] = {{
		["title"] = "__**Ultimate Title**__",
		["description"] = "blah blah",
		["type"] = "rich",
		["color"] = tonumber(0xffffff),
		["fields"] = {
			{
				["name"] = "__Title__",
				["value"] = "hi",
				["inline"] = true
			},
			{
				["name"] = "__Title__",
				["value"] = "hi",
				["inline"] = true
			}
		}
	}}
}

print(data)

local function SendDiscord(DscMsg)
	local Req_Url = Complete_Url .."?Key=" ..Api_Key.. "&Message=" ..tostring(DscMsg)
	HttpService:GetAsync(Req_Url)
end


SendDiscord(data) --Send a message, customize by editing the string!

If this works remember to mark this post as soloution!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.