Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a discord bot profile the same as the user? / HTTPService [closed]

Asked by
KDarren12 705 Donator Moderation Voter
5 years ago

I will send the code here, but not the webhook link.

local url = "webhook link is here" 


local http = game:GetService("HttpService")

game.Players.PlayerAdded:Connect(function(plr)
local HookData = {
['username'] = plr.Name,

['content'] =  msg
}


HookData = http:JSONEncode(HookData)


http:GetAsync(url, HookData) 
end)

If the player chats, it logs it in my discord server with their name as the bot name, and the message as the bot message. How would I make the profile picture of the bot the same as the user, just like #site-chat in the discord of scripting helpers?

0
this site is for roblox scripting, not discord Gameplayer365247v2 1055 — 5y
0
it is roblox scripting KDarren12 705 — 5y
0
It includes roblox scripting so HnN KDarren12 705 — 5y

Closed as off-topic by User#24403

This question has been closed by our community as being off-topic from ROBLOX Lua Scripting.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
tzmods 59
5 years ago
Edited by User#24403 5 years ago

First off, insert the following code into the command bar

game:GetService("HttpService").HttpEnabled = true

Make a server script and insert the following code

local url = ""
local http = game:GetService("HttpService")

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(msg)

        local Data = {
        ["avatar_url"] = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player.Name,
        ["username"] = player.Name,
        ["content"] = msg
        }

        Data = http:JSONEncode(Data)
        http:PostAsync(url, Data)
    end)
end)

Things to know

Remember to insert your discord webhook link into the quotation marks at the top.

If your game is popular, I don't recommend logging messages because you're logs will be constantly spammed with game chat.


Don't spoon feed!
Ad