Clebson Posted June 13, 2022 Share Posted June 13, 2022 (edited) 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 June 13, 2022 by Citizen Hiding the discord webhook id and secret. Never show them. Link to comment
Moderators Citizen Posted June 13, 2022 Moderators Share Posted June 13, 2022 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
Mr.Hugin Posted June 13, 2022 Share Posted June 13, 2022 (edited) 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 June 13, 2022 by Mr.Hugin Link to comment
Moderators Citizen Posted June 13, 2022 Moderators Share Posted June 13, 2022 @Mr.Hugin sendDiscordMessage doesn't exist (rename the function at line 3 from msg to sendDiscordMessage) 1 Link to comment
Mr.Hugin Posted June 13, 2022 Share Posted June 13, 2022 2 minutes ago, Citizen said: @Mr.Hugin sendDiscordMessage doesn't exist (rename the function at line 3 from msg to sendDiscordMessage) Thank you I am sorry for the mistake Link to comment
Recommended Posts