Jump to content

Ajuda com script de config?


Recommended Posts

Como pegar um link e colocar em um script de config?

No meu script ta assim

local url = "https://discord.com/api/webhooks/<webhookid>/<webhooksecret>"
function msg(mensagem)
	sendOptions = {
		queueName = "dcq",
		connectionAttempts = 10,
		connectionTimeout = 20000,
		formFields = {
			content = ""..mensagem.."",
		},
	}
	fetchRemote(url, sendOptions, callBack)
end

function callBack()
end

local time = getRealTime()
local hours = time.hour
local minutes = time.minute
local seconds = time.second

local monthday = time.monthday
local month = time.month
local year = time.year

local formattedTime = string.format('%02d/%02d/%02d - %02d:%02d:%02d', monthday, month + 1, year + 1900, hours, minutes, seconds)

 

Edited by Citizen
Hiding the discord webhook id and secret. Never show them.
Link to comment
  • Moderators

Hello,

I moved your topic to the Scripting section.

The Tutorials section is only for Scripting Tutorials, for scripting questions, use the Scripting section instead.

Make sure to use this section for your next scripting questions.

I also edited your code to hide your discord webhook id and secret, never share it or someone else can send message to the targeted discord channel.

Link to comment
1 hour ago, Clebson said:

Como pegar um link e colocar em um script de config?

No meu script ta assim

local url = "https://discord.com/api/webhooks/<webhookid>/<webhooksecret>"
function msg(mensagem)
	sendOptions = {
		queueName = "dcq",
		connectionAttempts = 10,
		connectionTimeout = 20000,
		formFields = {
			content = ""..mensagem.."",
		},
	}
	fetchRemote(url, sendOptions, callBack)
end

function callBack()
end

local time = getRealTime()
local hours = time.hour
local minutes = time.minute
local seconds = time.second

local monthday = time.monthday
local month = time.month
local year = time.year

local formattedTime = string.format('%02d/%02d/%02d - %02d:%02d:%02d', monthday, month + 1, year + 1900, hours, minutes, seconds)

 

local ulr = "https://discord.com/api/webhooks/<webhookid>/<webhooksecret>"
-----
function msgs(message)
	sendOptions = {
		formFields ={
			content="```"..message.."```"
	},
}
fetchRemote(ulr, sendOptions, WebhookCallback)
end
-----
function WebhookCallback(responseData)
	outputDebugString("(Discord webhook callback): responseData: ", responseData)
end
-----
function DiscordTestMessage(player, command, ...)
	local msg = table.concat({...}, " ")
	msgs(msg)
end
addCommandHandler("messages",DiscordTestMessage)

try this

Edited by Mr.Hugin
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...