Hey there! My Discord embed hasn't been sending, and I don't know why.
It gave me the error "HTTP 400 (Bad Request)", and I don't know what's wrong with my code! I've made sure HTTP services are on, and I've double checked my code, but I can't find what's wrong!
My code:
01 | function sendWebhook(user, rank) |
02 | local data = http:JSONEncode( { |
03 | { |
04 | [ "content" ] = "" , |
05 | [ "embeds" ] = { { |
06 | [ "title" ] = "USER PROMOTED" , |
07 | [ "type" ] = "rich" , |
08 | [ "color" ] = tonumber ( 0 xFFA 500 ), |
09 | [ "description" ] = user.. ' has been promoted to ' ..rank.. '!' , |
10 | [ "footer" ] = 'AutoRank created by ParticularlyPenguin' , |
11 |
12 | } } , |
13 | } , |
14 | } ) |
15 | http:PostAsync(webhook, data) |
16 | end |
All help will be appreciated.
Did A Bit Of Messing Around And Came Up With This:
01 | function sendWebhook(user, rank) |
02 | local data = { |
03 | [ "embeds" ] = { { |
04 | [ "color" ] = 5368 , |
05 | [ "title" ] = "USER PROMOTED" , |
06 | [ "description" ] = user.. " has been promoted to " ..rank.. "!" , |
07 | [ "fields" ] = { |
08 | } |
09 | } } |
10 | } |
11 | local newdata = http:JSONEncode(data) |
12 | http:PostAsync(webhook,newdata) |
13 | end |