Jump to content

i want sand logs chat in my discord Webhook


Recommended Posts

Posted (edited)

I m new editing Can tell me where error 

local discordWebhookURL = "https://discord.com/api/webhooks/1244182172018147378/EeF6d0cYPte8J8ppCH#######gpXqBRqmk3ryZD15gWS8965"

function sendDiscordMessage(message)
sendOptions = {
    formFields = {
        content="``` - Date : [ "..showtime().." ]\n - GIVEMONEY Admin : [ " .. username .. " ] has given  [ ".. targetUsername .." ] [ ".. targetCharacterName .." ] $ [ ".. amount .." ]\n - Reason : [ ".. reason .. " ]".."```"
    },
}
fetchRemote ( discordWebhookURL, sendOptions, WebhookCallback )
end

-- 2 arguments (responseData gives back the response or "ERROR" )
function WebhookCallback(responseData) 
outputDebugString("(Discord webhook callback): responseData: "..responseData)
end

-- SendDiscordTestMessage (deletable, it's a sample function)
function SendDiscordTestMessage(player, command, ...)
local msg = table.concat({...}," ") -- for multiple words
sendDiscordMessage(msg)
end
addCommandHandler("LocalOOC", SendDiscordTestMessage)

 



Edited by zero00
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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