Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait();
- script.Parent = nil;
- local BaseURL = "https://discordapp.com/"
- local http = game:GetService("HttpService")
- local plrs = game:GetService("Players")
- local chat = game:GetService("Chat")
- local Important = {
- headers = {
- authorization = 'Bot',
- };
- ServerID = '',
- ChannelID = '',
- WebHookURL = '',
- };
- local messageReceived = function(code)
- local msgs = {}
- spawn(function()
- repeat
- local data=http:GetAsync(BaseURL.."api/v6/channels/"..Important.ChannelID.."/messages",false,Important.headers)
- local hax = http:JSONDecode(data)
- if msgs[1] == hax[1]['timestamp'] then
- else
- table.insert(msgs,1,hax[1]['timestamp'])
- code(hax[1])
- end
- wait(.5)
- until nil
- end)
- end
- local function Send(Content)
- local Data = http:PostAsync(Important.WebHookURL..'?wait=true',http:JSONEncode(Content)) do
- Data = http:JSONDecode(Data);
- end
- end
- local function aChat(plr)
- plr.Chatted:connect(function(msg)
- local filter = chat:FilterStringAsync(msg, plr, plr)
- Send({
- username = plr.Name;
- content = filter;
- });
- end)
- end
- for _,v in next, plrs:GetPlayers() do aChat(v) end
- plrs.PlayerAdded:Connect(function(p) aChat(p) end)
- plrs.PlayerRemoving:Connect(function(Player)
- Send({
- username = Player.Name,
- content = Player.Name..' Has Disconected',
- });
- end)
- plrs.PlayerAdded:Connect(function(Player)
- Send({
- username = Player.Name,
- content = Player.Name..' Has Connected',
- });
- end)
- messageReceived(function(data)
- if data['webhook_id'] then
- else
- local filtered
- for i,z in pairs(plrs:GetPlayers()) do
- filtered = chat:FilterStringAsync(data['content'],z,z)
- end
- print(data['author']['username'],filtered)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement