Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Command to post to discord doesn't work?


Hello!Im back with another question

I have a bunch of chat commands.All of them work fine,until that one command that doesn't work when i type it correctly.I don't know what is wrong as there was no output error.Help!

Full Code:

local HTTPService = game:GetService("HttpService") -- For Calling HTTP

local url = "https://discordapp.com/api/webhooks/433910924521373696/_IgktSgqDwev6BicPO4vY8vCmASACbAjzGNX-ONDWcFgYliYVCoCZYlvpQNXC-p72pLl" -- Webhook

local commands = {
	c1 = "/partyhead",
	c2 = "/bts",
	c3 = "/getnumplr",
	c4 = "/givecash",
	c5 = "/discordpost"
}
local names = {
	name1 = "?????", -- Don't remove,its random name that i want to put
	name2 = "KawaiiX_Jimin"
}
local strings = {
	s1 = "ERROR LOADING COMMAND FOR YOU.DID YOU TYPE CORRECTLY OR IS YOUR NAME NOT ON THE LIST?",
	errorstring = "ERROR UPLOADING OR RUNNING,PLEASE REDO CODE",
}
local botdata = {
	content = "Hello Discord",
	username =  "Player Message"
}
game.Players.PlayerAdded:connect(function(pl)--DO NOT EDIT
	pl.Chatted:connect(function(msg)--DO NOT EDIT
		
		if msg == commands.c1 and pl.Name == names.name2 then -- Command 1 Runner
			while true do
				wait(3)
			pl.Character.Head.BrickColor = BrickColor.Random()
			end
			else 
	\
		end

		if msg == commands.c2 then -- Command 2 Runner
			print("BTS GALLERY LOADED")
			wait(0.3)
			pl.PlayerGui.BTS.ScrollingFrame.Visible = true
		if
			msg == commands.c3 then -- Command 3 Runner
			print("Loaded")
			print("Number of Players:".. game.Players.NumPlayers)
			end
		if
			msg == commands.c4 and pl.Name == names.name2 then -- Command 4 Runner
			pl.leaderstats.Bubbles.Value = pl.leaderstats.Bubbles.Value + 5000
		else
			--ALL CODE ABOVE WORK FINE UNTIL THE LAST ONE
			if msg == commands.c5 and pl.Name == names.name2 then -- Command 5 Runner
				local cfmeddata = HTTPService:JSONEncode(botdata)
				HTTPService:PostAsync(url,cfmeddata)
				print("Success!Check Discord!")
			elseif error then
				print(strings.errorstring)
			end
			end
		end
	end)
end)
--END

Command which doesn't work:


			if msg == commands.c5 and pl.Name == names.name2 then -- Command 5 Runner
				local cfmeddata = HTTPService:JSONEncode(botdata)
				HTTPService:PostAsync(url,cfmeddata)
				print("Success!Check Discord!")
			elseif error then
				print(strings.errorstring)
			end

1 answer


local HTTPService = game:GetService("HttpService") -- For Calling HTTP

local url = "discord.osyr.is/api/webhooks/433910924521373696/_IgktSgqDwev6BicPO4vY8vCmASACbAjzGNX-ONDWcFgYliYVCoCZYlvpQNXC-p72pLl" -- Webhook

local commands = {
    c1 = "/partyhead",
    c2 = "/bts",
    c3 = "/getnumplr",
    c4 = "/givecash",
    c5 = "/discordpost"
}
local names = {
    name1 = "?????", -- Don't remove,its random name that i want to put
    name2 = "KawaiiX_Jimin"
}
local strings = {
    s1 = "ERROR LOADING COMMAND FOR YOU.DID YOU TYPE CORRECTLY OR IS YOUR NAME NOT ON THE LIST?",
    errorstring = "ERROR UPLOADING OR RUNNING,PLEASE REDO CODE",
}
local botdata = {
    content = "Hello Discord",
    username =  "Player Message"
}
game.Players.PlayerAdded:connect(function(pl)--DO NOT EDIT
    pl.Chatted:connect(function(msg)--DO NOT EDIT

        if msg == commands.c1 and pl.Name == names.name2 then -- Command 1 Runner
            while true do
                wait(3)
            pl.Character.Head.BrickColor = BrickColor.Random()
            end
            else 
    \
        end

        if msg == commands.c2 then -- Command 2 Runner
            print("BTS GALLERY LOADED")
            wait(0.3)
            pl.PlayerGui.BTS.ScrollingFrame.Visible = true
        if
            msg == commands.c3 then -- Command 3 Runner
            print("Loaded")
            print("Number of Players:".. game.Players.NumPlayers)
            end
        if
            msg == commands.c4 and pl.Name == names.name2 then -- Command 4 Runner
            pl.leaderstats.Bubbles.Value = pl.leaderstats.Bubbles.Value + 5000
        else
            --ALL CODE ABOVE WORK FINE UNTIL THE LAST ONE
            if msg == commands.c5 and pl.Name == names.name2 then -- Command 5 Runner
                local cfmeddata = HTTPService:JSONEncode(botdata)
                HTTPService:PostAsync(url,cfmeddata)
                print("Success!Check Discord!")
            elseif error then
                print(strings.errorstring)
            end
            end
        end
    end)
end)

BTW to do what i done (this is from the owner of discord): My proxy server is public to use and I’ve checked with Discord staff to ensure you won’t be breaking any rules.

It’s very simple to use, you just replace “discordapp.com 2” in your webhook URL with “discord.osyr.is”

2 comments

0

BTW DONT POST WEBHOOKS ANYWHERE EVEN IN SCRIPTS DOING SO CAN GET YOUR DISCORD SERVER SPAM BOTTED

0

Still doesn't post on discord :/

This discussion is preserved as it was. New answers, comments, and votes are closed.