Прокси для Discord-вебхуковDiscord webhook proxy
hooks.0ae.dev
Discord не принимает вебхуки с серверов Roblox. Этот прокси пересылает их за вас, соблюдает лимиты Discord и держит очередь, чтобы много серверов не положили ваш вебхук. Discord rejects webhooks sent from Roblox servers. This proxy forwards them for you, respects Discord’s limits and queues messages so many game servers don’t get your webhook banned.
проверяю статус…checking status…
Миграция за одну заменуMigrate with one replace
Возьмите ваш обычный вебхук и замените в нём только хост. Путь, токен и параметры остаются как есть.Take your normal webhook URL and change the host only. Path, token and query stay the same.
local HttpService = game:GetService("HttpService")
local URL = "https://hooks.0ae.dev/api/webhooks/ID/TOKEN"
local function send(payload)
local ok, err = pcall(function()
return HttpService:PostAsync(
URL,
HttpService:JSONEncode(payload),
Enum.HttpContentType.ApplicationJson
)
end)
if not ok then warn("webhook:", err) end -- 429 = queue full
end
send({ content = "Server started", username = "Game logs" })Правка и удаление сообщенийEditing and deleting messages
Нужен RequestAsync: PostAsync умеет только POST. Добавьте ?wait=true, чтобы получить id сообщения.Use RequestAsync: PostAsync can only POST. Add ?wait=true to get the message id.
local json = { ["Content-Type"] = "application/json" }
local res = HttpService:RequestAsync({
Url = URL .. "?wait=true", Method = "POST", Headers = json,
Body = HttpService:JSONEncode({ content = "v1" }),
})
local id = HttpService:JSONDecode(res.Body).id
HttpService:RequestAsync({
Url = URL .. "/messages/" .. id, Method = "PATCH", Headers = json,
Body = HttpService:JSONEncode({ content = "v2" }),
})
HttpService:RequestAsync({ Url = URL .. "/messages/" .. id, Method = "DELETE" })Как это работаетHow it works
- Для каждого вебхука своя очередь: запросы уходят в Discord по одному, по заголовкам
X-RateLimit-*. Ответ Discord возвращается вам как есть.Each webhook has its own queue: requests go to Discord one at a time, paced byX-RateLimit-*headers. Discord’s response is returned to you unchanged. - Если Discord ответил 429, прокси подождёт
retry_afterи повторит запрос сам.If Discord answers 429, the proxy waitsretry_afterand retries for you. - Если очередь длиннее ~10 секунд, вы получите
429сretry_afterиRetry-After. В Roblox это исключение: оберните вызов вpcallи повторите позже.If the queue is longer than ~10 seconds you get429withretry_afterandRetry-After. In Roblox that is an error: wrap the call inpcalland retry later. - Неверный токен (401) и удалённый вебхук (404) запоминаются на время, и мы перестаём стучаться в Discord: он банит IP за поток 401/403/429.Invalid tokens (401) and deleted webhooks (404) are cached for a while and we stop hitting Discord: it bans IPs for floods of 401/403/429.
- Поддерживаются JSON и multipart (файлы) до 2 МБ, параметры
wait,thread_id,with_components.JSON and multipart (files) up to 2 MB, withwait,thread_idandwith_componentsquery parameters. - Мы не логируем содержимое сообщений. Не используйте прокси для спама и нарушений правил Discord: такие вебхуки блокируются.We don’t log message content. Don’t use the proxy for spam or anything against Discord’s rules: such webhooks get blocked.
Лимит Roblox: 500 HTTP-запросов в минуту с сервера, а Discord отдаёт вебхуку около 5 сообщений за 2 секунды. Собирайте события в один embed, а не шлите по одному.Roblox allows 500 HTTP requests per minute per server and Discord gives a webhook about 5 messages per 2 seconds. Batch events into one embed instead of sending them one by one.
Свой алиас: токен не попадает в игруYour own alias: keep the token out of the game
Алиас хранит ваш вебхук на сервере и отдаёт адрес /h/<id>. Можно задать секретный заголовок X-Hook-Secret, формат сообщения и смотреть журнал доставок. Если адрес утёк, удалите алиас: сам вебхук в Discord останется нетронутым.An alias stores your webhook server-side and gives you a /h/<id> URL. You can set a secret X-Hook-Secret header, a message format and see a delivery log. If the URL leaks, delete the alias; the Discord webhook itself stays untouched.
Roblox шлёт простой JSON, сервис собирает embed:Roblox sends simple JSON, the service builds the embed:
HttpService:RequestAsync({
Url = "https://hooks.0ae.dev/h/YOUR_ALIAS_ID", Method = "POST",
Headers = { ["Content-Type"] = "application/json", ["X-Hook-Secret"] = "YOUR_SECRET" },
Body = HttpService:JSONEncode({
title = "Player joined", text = player.Name, color = "#57F287",
fields = { { name = "Place", value = tostring(game.PlaceId), inline = true } },
}),
})Секрет в скрипте виден всем, у кого есть доступ к месту; он защищает только от посторонних. Пинги (@everyone) в режимах simple и template отключены.A secret in a script is visible to anyone with access to the place; it only stops outsiders. Mentions (@everyone) are disabled in simple and template modes.
Управление алиасомManage an alias
СправкаReference
| Endpoint | Что делаетWhat it does |
|---|---|
| POST /api/webhooks/:id/:token | Отправить сообщение (?wait, ?thread_id)Send a message (?wait, ?thread_id) |
| PATCH, DELETE …/messages/:id | Изменить, удалить; GET читает сообщениеEdit, delete; GET reads a message |
| POST /h/:alias | Отправить через алиасSend through an alias |
| /api/alias | POST создать; /:id GET, PATCH, DELETE, /:id/log GET; Authorization: Bearer <токен>POST create; /:id GET, PATCH, DELETE, /:id/log GET; Authorization: Bearer <token> |
| GET /status | Состояние сервисаService health |