واجهة API لأصحاب البوتات
بِع أماكن كتلة الاشتراك الإجباري في بوتك: تقدّم Briza Hub قنوات المعلنين وتدفع مقابل كل مشترك.
كيف تربح
- حصتك 85% من سعر المهمة. تختلف الأسعار حسب الطلب؛ وبالسعر الأساسي 0.01955 USDT لكل مشترك.
- يُدفع مقابل الاشتراك مع التحقق بعد بقاء الشخص 24 ساعة.
- السحب — في @BrizaHubBot ← «بيع الترافيك»، ابتداءً من 3 USDT، خلال 24 ساعة.
- ترافيك من أي دولة وبأي لغة.
- تُدفع المهام بلا تحقق وطلبات الانضمام وتشغيلات البوتات والنقرات فورًا.
- @CryptoBot و@xRocket — بلا عمولة؛ محفظة USDT (TRC-20 وBEP-20 وTON) — قريبًا.
- الترافيك المزيف يعني الحظر وتجميد السحب.
- أوقف المعلن الطلب أو حذفه أو غيّر القناة أو أزال بوتنا — تُحتسب المهام الموزعة قبل ذلك رغم ذلك.
البدء السريع
بايثون في دقيقتين، واللغات الأخرى في 5 دقائق
يأخذ بوتك من Briza مهام للمستخدم، ويعرضها أزرارًا ويتحقق من الاشتراك.
الخطوة 1 · احصل على المفتاح
@BrizaHubBot ← «بيع الترافيك» ← «ربط بوت» ← «عبر التوكن». بعد المراجعة (عادةً خلال يوم) يرسل البوت مفتاح API — ضعه مكان your_key_here.
الخطوة 2 · بايثون: ثبّت الحزمة أسرع
الطلبات والمهلة والأخطاء داخل الحزمة: لا رد خلال 3 ثوانٍ أو حدث خطأ — يمر المستخدم.
pip install brizahub
pip install "brizahub[aiogram]" # + middleware for aiogram 3الخطوة 3 · سطر واحد في المعالج
- جاهز —
check: تعرض Briza الكتلة باسم بوتك (يلزم توكن البوت). - كتلتك الخاصة —
get_sponsorsوcheck_sponsors: أنت ترسم الأزرار، ولا يلزم توكن. - aiogram — وسيط (middleware): التحقق قبل كل المعالجات دفعة واحدة.
from brizahub import Briza
# your key from @BrizaHubBot; smart_links — more advertisers: device-targeted orders and visits
briza = Briza("your_key_here", smart_links=True)
@dp.message()
async def work(message: Message) -> None:
if not await briza.check(message.from_user): # False — Briza has shown the sponsors as your bot
return
await message.answer("⏳ Downloading…") # your bot's real workfrom brizahub import Briza
# your key from @BrizaHubBot; smart_links and mini_apps — more advertisers: device-targeted orders, visits, mini apps
briza = Briza("your_key_here", smart_links=True, mini_apps=True)
def block(sponsors) -> InlineKeyboardMarkup:
# a visit may go to another offer for this device — label it generically, not with the site's name
rows = [[InlineKeyboardButton(text="🎁 Offer" if s.type == "link" else s.title or "Subscribe", url=s.link)]
for s in sponsors]
rows.append([InlineKeyboardButton(text="✅ Check", callback_data="briza:check")])
return InlineKeyboardMarkup(inline_keyboard=rows)
@dp.message()
async def work(message: Message) -> None:
photos = await message.bot.get_user_profile_photos(message.from_user.id, limit=1) # «photo only» pay more
sponsors = await briza.get_sponsors(message.from_user, has_photo=photos.total_count > 0)
if sponsors: # [] — let the user in
await message.answer("Join our sponsors to use the bot:", reply_markup=block(sponsors))
return
await message.answer("⏳ Downloading…")
@dp.callback_query(F.data == "briza:check")
async def check(call: CallbackQuery) -> None:
if await briza.check_sponsors(call.from_user): # not joined yet
await call.answer("Please join all the channels first", show_alert=True)
return
await call.message.edit_text("✅ Thank you! Now send me a link.")from brizahub import Briza
from brizahub.aiogram import BrizaMiddleware
# your key from @BrizaHubBot; smart_links — more advertisers: device-targeted orders and visits
briza = Briza("your_key_here", smart_links=True)
dp.message.middleware(BrizaMiddleware(briza)) # the check runs before every handler
dp.callback_query.middleware(BrizaMiddleware(briza))
dp.shutdown.register(briza.close)تم. تصميم كتلتك وكل المعاملات — في وصف الحزمة.
لغات أخرى: HTTP API
بدون الحزمة — طلبان إلى API بأي لغة.
العنوان: https://api.brizahub.com. المفتاح: Authorization: Bearer ….
1 · أول طلب: مهام المستخدم
عندما يراسل المستخدم بوتك، اطلب له المهام:
# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/tasks" \
-H "Authorization: Bearer your_key_here" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"language_code": "fa",
"is_premium": false,
"has_photo": true,
"first_name": "Ali",
"smart_links": true,
"mini_apps": true
}'import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
# user — message.from_user; has_photo — getUserProfilePhotos(user.id).total_count > 0
async def briza_tasks(user, has_photo: bool) -> dict:
async with aiohttp.ClientSession() as s:
async with s.post("https://api.brizahub.com/v1/tasks", headers=HEADERS, json={
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"has_photo": has_photo,
"first_name": user.first_name,
"smart_links": True,
"mini_apps": True,
}) as r:
return await r.json()const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
// user — ctx.from; hasPhoto — getUserProfilePhotos(user.id).total_count > 0
async function brizaTasks(user, hasPhoto) {
const r = await fetch("https://api.brizahub.com/v1/tasks", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
user_id: user.id,
language_code: user.language_code,
is_premium: !!user.is_premium,
has_photo: hasPhoto,
first_name: user.first_name,
smart_links: true,
mini_apps: true,
}),
});
return r.json();
}<?php
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
// $user — $update['message']['from']; $hasPhoto — getUserProfilePhotos: total_count > 0
function briza_tasks(array $user, bool $hasPhoto): ?array {
$ch = curl_init('https://api.brizahub.com/v1/tasks');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'user_id' => $user['id'],
'language_code' => $user['language_code'] ?? null,
'is_premium' => !empty($user['is_premium']),
'has_photo' => $hasPhoto,
'first_name' => $user['first_name'],
'smart_links' => true,
'mini_apps' => true,
]),
CURLOPT_RETURNTRANSFER => true,
]);
return json_decode(curl_exec($ch), true);
}{
"ok": true,
"tasks": [
{
"task_id": "t_Qx3kW2",
"type": "channel",
"link": "https://t.me/+AbCdEf",
"title": "Persian News",
"price": "0.01955",
"photo": "https://api.brizahub.com/photo/3f9c2a1b7d4e8f0a6c5b.jpg"
}
]
}2 · عالج الرد
كل شيء يدور حول قائمة tasks:
| رد Briza | بوتك |
|---|---|
tasks فارغة | مرّر المستخدم. "suspicious": true — نظام مكافحة الاحتيال لدينا علّم هذا المستخدم؛ والقرار لك. |
في tasks مهام | أزرار بالروابط link وزر «تحقق» ← POST /v1/tasks/check. أوقفه ما دامت هناك مهمة incomplete. |
| خطأ، أو لا رد خلال 3 ثوانٍ | مرّر المستخدم. |
معالج بسيط:
import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
BRIZA = "https://api.brizahub.com"
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
TIMEOUT = aiohttp.ClientTimeout(total=3)
async def briza(path: str, payload: dict) -> dict:
"""{} if Briza did not answer — let the user in."""
try:
async with aiohttp.ClientSession(timeout=TIMEOUT) as s:
async with s.post(BRIZA + path, json=payload, headers=HEADERS) as r:
return await r.json() if r.status == 200 else {}
except (aiohttp.ClientError, TimeoutError):
return {}
async def sponsors(user, has_photo: bool | None = None) -> list[dict]:
"""user — message.from_user; has_photo — getUserProfilePhotos(user.id).total_count > 0. Empty — let the user in."""
return (await briza("/v1/tasks", {
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"first_name": user.first_name,
"has_photo": has_photo, # «photo only» orders pay more
"smart_links": True, # more advertisers: device-targeted orders and visits
"mini_apps": True, # mini app tasks too
})).get("tasks", [])
async def must_hold(user_id: int, task_ids: list[str]) -> bool:
"""«Check» pressed. True — hold the user."""
answer = await briza("/v1/tasks/check", {"user_id": user_id, "task_ids": task_ids})
return any(x["status"] == "incomplete" for x in answer.get("results", []))const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const BRIZA = "https://api.brizahub.com";
const HEADERS = { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" };
// {} if Briza did not answer — let the user in
async function briza(path, payload) {
try {
const r = await fetch(BRIZA + path, {
method: "POST", headers: HEADERS, body: JSON.stringify(payload), signal: AbortSignal.timeout(3000),
});
return r.ok ? await r.json() : {};
} catch {
return {};
}
}
// user — ctx.from; hasPhoto — getUserProfilePhotos(user.id).total_count > 0. Empty — let the user in
export async function sponsors(user, hasPhoto) {
return (await briza("/v1/tasks", {
user_id: user.id,
language_code: user.language_code,
is_premium: !!user.is_premium,
first_name: user.first_name,
has_photo: hasPhoto, // «photo only» orders pay more
smart_links: true, // more advertisers: device-targeted orders and visits
mini_apps: true, // mini app tasks too
})).tasks ?? [];
}
// «Check» pressed. true — hold the user
export async function mustHold(userId, taskIds) {
const answer = await briza("/v1/tasks/check", { user_id: userId, task_ids: taskIds });
return (answer.results ?? []).some((x) => x.status === "incomplete");
}<?php
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
// [] if Briza did not answer — let the user in
function briza(string $path, array $payload): array {
$ch = curl_init('https://api.brizahub.com' . $path);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
]);
$body = curl_exec($ch);
$ok = $body !== false && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200;
curl_close($ch);
return $ok ? (json_decode($body, true) ?? []) : [];
}
// $user — $update['message']['from']; $hasPhoto — getUserProfilePhotos total_count > 0. Empty — let the user in
function sponsors(array $user, ?bool $hasPhoto = null): array {
return briza('/v1/tasks', [
'user_id' => $user['id'],
'language_code' => $user['language_code'] ?? null,
'is_premium' => !empty($user['is_premium']),
'first_name' => $user['first_name'],
'has_photo' => $hasPhoto, // «photo only» orders pay more
'smart_links' => true, // more advertisers: device-targeted orders and visits
'mini_apps' => true, // mini app tasks too
])['tasks'] ?? [];
}
// «Check» pressed. true — hold the user
function must_hold(int $userId, array $taskIds): bool {
$answer = briza('/v1/tasks/check', ['user_id' => $userId, 'task_ids' => $taskIds]);
foreach ($answer['results'] ?? [] as $x) {
if ($x['status'] === 'incomplete') return true;
}
return false;
}أو الوضع الجاهز: تعرض Briza الكتلة، ويبقى لك سطر واحد — if not await briza_check(user): return.
لا يوجد مبرمج؟ خذ رابطًا ذكيًا: @BrizaHubBot ← «بيع الترافيك» ← «ربط بوت» ← «بدون كود». ضعه في الاشتراك الإجباري أو القائمة — نعرض المهام ونتحقق من الاشتراكات بأنفسنا.
الوضع الجاهز: Briza تعرض كتلة الاشتراك الإجباري
سطر واحد في المعالجات: if not await briza.check(message.from_user): return.
- ترسل توكن البوت عند الربط؛ تبقى تحديثات بوتك عندك.
skip: true— مرّره،false— عُرضت الكتلة، أوقفه. لا رد خلال 3 ثوانٍ — مرّره: لن تصل الكتلة لاحقًا.- لا يوجد زر «تحقق»: اشترك المستخدم — يختفي الزر من الكتلة تلقائيًا؛ راسل بوتك مجددًا — استدعِ
/v1/check: نمرّره أو نعرض ما تبقّى. - مظهر خاص — في
message.
بوت كامل:
# pip install "brizahub[aiogram]" — Briza Hub turnkey
import asyncio
from aiogram import Bot, Dispatcher
from aiogram.filters import CommandStart
from aiogram.types import Message
from brizahub import Briza
from brizahub.aiogram import BrizaMiddleware
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here" # your bot's token from @BotFather
bot = Bot(BOT_TOKEN)
dp = Dispatcher()
briza = Briza(BRIZA_KEY, smart_links=True) # more advertisers: device-targeted orders and visits
dp.message.middleware(BrizaMiddleware(briza)) # force-sub before every handler
dp.callback_query.middleware(BrizaMiddleware(briza))
dp.shutdown.register(briza.close)
@dp.message(CommandStart())
async def start(message: Message) -> None:
await message.answer("Hi! Send me a link and I will download the video.")
@dp.message()
async def work(message: Message) -> None:
await message.answer("⏳ Downloading…") # your bot's real work
if __name__ == "__main__":
asyncio.run(dp.start_polling(bot))# pip install aiogram aiohttp — Briza Hub turnkey
import asyncio
import aiohttp
from aiogram import Bot, Dispatcher
from aiogram.filters import CommandStart
from aiogram.types import Message, User
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here" # your bot's token from @BotFather
bot = Bot(BOT_TOKEN)
dp = Dispatcher()
photos: dict[int, bool] = {} # user_id → has a profile photo (asked once per user)
async def has_photo(user_id: int) -> bool | None:
"""«Photo only» orders pay more. None — unknown, not sent."""
if user_id not in photos:
try:
photos[user_id] = (await bot.get_user_profile_photos(user_id, limit=1)).total_count > 0
except Exception:
return None
return photos[user_id]
async def briza_check(user: User) -> bool:
"""True — let the user in. False — block shown, stop."""
payload = {
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"first_name": user.first_name,
"has_photo": await has_photo(user.id),
"smart_links": True, # more advertisers: device-targeted orders and visits
}
try:
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=3)) as s:
async with s.post("https://api.brizahub.com/v1/check", json=payload,
headers={"Authorization": f"Bearer {BRIZA_KEY}"}) as r:
return (await r.json()).get("skip", True) if r.status == 200 else True
except (aiohttp.ClientError, TimeoutError):
return True # Briza did not answer: never hold the user
@dp.message(CommandStart())
async def start(message: Message) -> None:
# use it wherever the check is needed
if not await briza_check(message.from_user):
return
await message.answer("Hi! Send me a link and I will download the video.")
@dp.message()
async def work(message: Message) -> None:
if not await briza_check(message.from_user):
return
await message.answer("⏳ Downloading…") # your bot's real work
async def main() -> None:
await dp.start_polling(bot)
if __name__ == "__main__":
asyncio.run(main())// npm i grammy — Briza Hub turnkey (Node.js 18+)
import { Bot } from "grammy";
const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const BOT_TOKEN = "your_bot_token_here"; // your bot's token from @BotFather
const bot = new Bot(BOT_TOKEN);
const photos = new Map(); // userId → has a profile photo (asked once per user)
// «Photo only» orders pay more; undefined — unknown, not sent
async function hasPhoto(userId) {
if (!photos.has(userId)) {
try {
photos.set(userId, (await bot.api.getUserProfilePhotos(userId, { limit: 1 })).total_count > 0);
} catch {
return undefined;
}
}
return photos.get(userId);
}
// true — let the user in; false — block shown, stop
async function brizaCheck(user) {
const payload = {
user_id: user.id,
language_code: user.language_code,
is_premium: !!user.is_premium,
first_name: user.first_name,
has_photo: await hasPhoto(user.id),
smart_links: true, // more advertisers: device-targeted orders and visits
};
try {
const r = await fetch("https://api.brizahub.com/v1/check", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify(payload),
signal: AbortSignal.timeout(3000),
});
return r.ok ? (await r.json()).skip !== false : true;
} catch {
return true; // Briza did not answer: never hold the user
}
}
bot.command("start", async (ctx) => {
// use it wherever the check is needed
if (!(await brizaCheck(ctx.from))) return;
await ctx.reply("Hi! Send me a link and I will download the video.");
});
bot.on("message", async (ctx) => {
if (!(await brizaCheck(ctx.from))) return;
await ctx.reply("⏳ Downloading…"); // your bot's real work
});
bot.start();<?php
// A Telegram bot on a webhook, no libraries — Briza Hub turnkey
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
const BOT_TOKEN = 'your_bot_token_here'; // your bot's token from @BotFather
// true — let the user in; false — block shown, stop
function briza_check(array $user): bool {
$payload = [
'user_id' => $user['id'],
'language_code' => $user['language_code'] ?? null,
'is_premium' => !empty($user['is_premium']),
'first_name' => $user['first_name'],
'has_photo' => has_photo($user['id']),
'smart_links' => true, // more advertisers: device-targeted orders and visits
];
$ch = curl_init('https://api.brizahub.com/v1/check');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
]);
$body = curl_exec($ch);
$ok = $body !== false && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200;
curl_close($ch);
if (!$ok) return true; // Briza did not answer: never hold the user
return (json_decode($body, true)['skip'] ?? true) !== false;
}
function tg(string $method, array $params): ?array {
$url = 'https://api.telegram.org/bot' . BOT_TOKEN . '/' . $method;
$r = @file_get_contents($url, false, stream_context_create(['http' => [
'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => json_encode($params),
]]));
return $r === false ? null : (json_decode($r, true)['result'] ?? null);
}
// «Photo only» orders pay more (cache it per user in production); null — unknown
function has_photo(int $userId): ?bool {
$r = tg('getUserProfilePhotos', ['user_id' => $userId, 'limit' => 1]);
return $r === null ? null : $r['total_count'] > 0;
}
$update = json_decode(file_get_contents('php://input'), true);
$msg = $update['message'] ?? null;
if ($msg) {
if (!briza_check($msg['from'])) exit; // use it wherever the check is needed
$start = ($msg['text'] ?? '') === '/start';
tg('sendMessage', ['chat_id' => $msg['chat']['id'],
'text' => $start ? 'Hi! Send me a link and I will download the video.' : '⏳ Downloading…']);
}# Your key from @BrizaHubBot
BRIZA_KEY="your_key_here"
# Briza checks the user and shows the block itself
curl -s https://api.brizahub.com/v1/check \
-H "Authorization: Bearer $BRIZA_KEY" -H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"language_code": "fa",
"is_premium": false,
"has_photo": true,
"first_name": "Ali",
"smart_links": true
}'
# → {"ok": true, "skip": true} — let the user in
# → {"ok": true, "skip": false, "tasks": [...], "message_id": 4521} — block shown, stop
# The user wrote to your bot again — the same call: let through or the block with what's leftمرجع API
https://api.brizahub.com، المفتاح في Authorization: Bearer …، JSON. الحد: 65 طلبًا في الثانية.
مفتاح للقراءة فقط (bzr_…) — للوحة الإحصاءات أو للمحاسب: يفتح /v1/me و/v1/stats و/v1/balance ولا يصدر مهام. أنشئه في @BrizaHubBot: بطاقة البوت ← «👁 مفتاح للقراءة فقط».
POST/v1/tasks
مهام كتلة الاشتراك الإجباري. ما دام المستخدم لم يُنجزها تعود نفسها. بعد اجتياز الكتلة لا مهام جديدة حتى إعادة ضبط القائمة (إعدادات البوت في @BrizaHubBot، الافتراضي 6 ساعات).
المعاملات
user_idintegerإلزاميfrom.idlimitintegerاختياري1–10، الأكثر يُقلَّص إلى 10. الافتراضي — إعداد البوت (5).
language_codestringاختياريfrom.language_code. إن لم ترسله — نحدده من user_id.is_premiumbooleanاختياريfrom.is_premiumhas_photobooleanاختياريهل لدى المستخدم صورة ملف شخصي (يراها بوتك عبر
getUserProfilePhotos). يتيح طلبات «بصورة فقط»؛ ونتحقق منها بعد الاشتراك.first_namestringاختياريfrom.first_name— نقارنه مع تيليجرام بعد الاشتراك.min_pricestringاختياريأدنى مبلغ لكل مهمة، USDT، مثل
"0.015".smart_linksbooleanاختياريهل تأخذ مهامًا بـروابط ذكية. ننصح بـ
true: معلنون أكثر.mini_appsbooleanاختياريهل تأخذ مهام التطبيقات المصغّرة (
type: app). بدونtrueلن تصلك.
حقول الرد
tasksarrayفارغة — مرّر المستخدم.
task_idstringلـ
/v1/tasks/check.typestringchannel،group،bot،link،folder(مجلد —t.me/addlist/…؛ اعرضه مثل القناة)،app(تطبيق مصغّر لبوت؛ زر «فتح»).linkstringرابط الزر.
titlestringنص الزر.
pricestringما تحصل عليه، USDT.
photostringصورة القناة أو المجموعة أو البوت (للتطبيق المصغّر — صورة بوته): رابط لصورة JPEG بحجم 320×320 بكسل بالضبط على
api.brizahub.com، الحجم نفسه لكل المهام. إن لم توجد صورة، أو كان موقعًا أو مجلدًا — صورة بديلة بنمط تيليجرام بالحجم نفسه.photo_placeholderbooleantrue— فيphotoصورة بديلة (تدرّج لوني وحروف أولى): اعرضها أو ارسم صورتك. للصورة الحقيقية لا يوجد هذا الحقل.
مثال
# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/tasks" \
-H "Authorization: Bearer your_key_here" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"language_code": "fa",
"is_premium": false,
"has_photo": true,
"first_name": "Ali",
"smart_links": true,
"mini_apps": true
}'import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
# user — message.from_user; has_photo — getUserProfilePhotos(user.id).total_count > 0
async def briza_tasks(user, has_photo: bool) -> dict:
async with aiohttp.ClientSession() as s:
async with s.post("https://api.brizahub.com/v1/tasks", headers=HEADERS, json={
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"has_photo": has_photo,
"first_name": user.first_name,
"smart_links": True,
"mini_apps": True,
}) as r:
return await r.json()const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
// user — ctx.from; hasPhoto — getUserProfilePhotos(user.id).total_count > 0
async function brizaTasks(user, hasPhoto) {
const r = await fetch("https://api.brizahub.com/v1/tasks", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
user_id: user.id,
language_code: user.language_code,
is_premium: !!user.is_premium,
has_photo: hasPhoto,
first_name: user.first_name,
smart_links: true,
mini_apps: true,
}),
});
return r.json();
}<?php
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
// $user — $update['message']['from']; $hasPhoto — getUserProfilePhotos: total_count > 0
function briza_tasks(array $user, bool $hasPhoto): ?array {
$ch = curl_init('https://api.brizahub.com/v1/tasks');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'user_id' => $user['id'],
'language_code' => $user['language_code'] ?? null,
'is_premium' => !empty($user['is_premium']),
'has_photo' => $hasPhoto,
'first_name' => $user['first_name'],
'smart_links' => true,
'mini_apps' => true,
]),
CURLOPT_RETURNTRANSFER => true,
]);
return json_decode(curl_exec($ch), true);
}{
"ok": true,
"tasks": [
{
"task_id": "t_Qx3kW2",
"type": "channel",
"link": "https://t.me/+AbCdEf",
"title": "Persian News",
"price": "0.01955",
"photo": "https://api.brizahub.com/photo/3f9c2a1b7d4e8f0a6c5b.jpg"
}
]
}POST/v1/tasks/check
يتحقق من المهام عند الضغط على «تحقق».
المعاملات
user_idintegerإلزاميfrom.idtask_idsarrayإلزامي1–20 من
task_id.
حقول الرد
resultsarrayواحدة لكل
task_id.statusstringincomplete،pending،completed،unavailable— الحالات.reasonstringلـ
unavailable:expired،order_inactive،member،left،not_paid,suspicious،removed،unconfirmed،check_failed،not_found.
مثال
# user_id — from the Telegram user; task_ids — the tasks you showed
curl -s -X POST "https://api.brizahub.com/v1/tasks/check" \
-H "Authorization: Bearer your_key_here" \
-H "Content-Type: application/json" \
-d '{"user_id": 123456789, "task_ids": ["t_Qx3kW2", "t_Lm9pR4"]}'import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
# user — call.from_user; task_ids — the tasks you showed
async def briza_check_tasks(user, task_ids: list[str]) -> dict:
async with aiohttp.ClientSession() as s:
async with s.post("https://api.brizahub.com/v1/tasks/check", headers=HEADERS,
json={"user_id": user.id, "task_ids": task_ids}) as r:
return await r.json()const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
// user — ctx.from; taskIds — the tasks you showed
async function brizaCheckTasks(user, taskIds) {
const r = await fetch("https://api.brizahub.com/v1/tasks/check", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ user_id: user.id, task_ids: taskIds }),
});
return r.json();
}<?php
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
// $user — $update['callback_query']['from']; $taskIds — the tasks you showed
function briza_check_tasks(array $user, array $taskIds): ?array {
$ch = curl_init('https://api.brizahub.com/v1/tasks/check');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['user_id' => $user['id'], 'task_ids' => $taskIds]),
CURLOPT_RETURNTRANSFER => true,
]);
return json_decode(curl_exec($ch), true);
}{
"ok": true,
"results": [
{
"task_id": "t_Qx3kW2",
"status": "pending"
},
{
"task_id": "t_Lm9pR4",
"status": "incomplete"
}
]
}POST/v1/check
يتحقق من المستخدم ويعرض عند الحاجة كتلة الاشتراك الإجباري باسم بوتك.
المعاملات
user_idintegerإلزاميfrom.idchat_idintegerاختياريالافتراضي —
user_id.limitintegerاختياري1–10، الأكثر يُقلَّص إلى 10. الافتراضي — إعداد البوت (5).
language_codestringاختياريبأي لغة تُعرض كتلة الاشتراك الإجباري (
from.language_code، 30 لغة في تيليجرام). إن لم ترسله — نحددها من user_id؛ وإن لم نعرفها — الإنجليزية.is_premiumbooleanاختياريfrom.is_premiumhas_photobooleanاختياريهل لدى المستخدم صورة ملف شخصي (يراها بوتك عبر
getUserProfilePhotos). يتيح طلبات «بصورة فقط»؛ ونتحقق منها بعد الاشتراك.first_namestringاختياريfrom.first_name— نقارنه مع تيليجرام بعد الاشتراك.messageobjectاختياريtextحتى 4096 حرفًا: HTML أوparse_modeMarkdownV2أوentitiesمن رسالة جاهزة؛ رموز تعبيرية مميزة، و$name— اسم المستخدم.rows(1–3)،button_join،button_channel،button_bot،button_url؛ أيقونةbutton_icon(معرّف الرمز المميز)، ولونbutton_style. تظهر الرموز المميزة إذا كان لدى مالك البوت اشتراك Telegram Premium.min_pricestringاختياريأدنى مبلغ لكل مهمة، USDT، مثل
"0.015".smart_linksbooleanاختياريهل تأخذ مهامًا بـروابط ذكية. ننصح بـ
true: معلنون أكثر.
حقول الرد
skipbooleantrue— مرّره،false— أوقفه.tasksarrayالمهام في الكتلة.
message_idintegerرسالة الكتلة.
مثال
# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/check" \
-H "Authorization: Bearer your_key_here" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"language_code": "fa",
"is_premium": false,
"has_photo": true,
"first_name": "Ali",
"smart_links": true
}'import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
# user — message.from_user; has_photo — getUserProfilePhotos(user.id).total_count > 0
async def briza_check(user, has_photo: bool) -> dict:
async with aiohttp.ClientSession() as s:
async with s.post("https://api.brizahub.com/v1/check", headers=HEADERS, json={
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"has_photo": has_photo,
"first_name": user.first_name,
"smart_links": True,
}) as r:
return await r.json()const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
// user — ctx.from; hasPhoto — getUserProfilePhotos(user.id).total_count > 0
async function brizaCheck(user, hasPhoto) {
const r = await fetch("https://api.brizahub.com/v1/check", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
user_id: user.id,
language_code: user.language_code,
is_premium: !!user.is_premium,
has_photo: hasPhoto,
first_name: user.first_name,
smart_links: true,
}),
});
return r.json();
}<?php
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
// $user — $update['message']['from']; $hasPhoto — getUserProfilePhotos: total_count > 0
function briza_check(array $user, bool $hasPhoto): ?array {
$ch = curl_init('https://api.brizahub.com/v1/check');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'user_id' => $user['id'],
'language_code' => $user['language_code'] ?? null,
'is_premium' => !empty($user['is_premium']),
'has_photo' => $hasPhoto,
'first_name' => $user['first_name'],
'smart_links' => true,
]),
CURLOPT_RETURNTRANSFER => true,
]);
return json_decode(curl_exec($ch), true);
}{
"ok": true,
"skip": false,
"tasks": [
{
"task_id": "t_Qx3kW2",
"type": "channel",
"link": "https://t.me/+AbCdEf",
"title": "Persian News",
"price": "0.01955",
"photo": "https://api.brizahub.com/photo/3f9c2a1b7d4e8f0a6c5b.jpg"
}
],
"message_id": 4521
}GET/v1/me
منصتك وعدّادات اليوم.
بلا معاملات.
حقول الرد
platformobjectالاسم والحالة والويب هوك وتوكن البوت.
statsobjectاليوم والإجمالي.
مثال
curl -s "https://api.brizahub.com/v1/me" \
-H "Authorization: Bearer your_key_here"import asyncio
import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
async def main():
async with aiohttp.ClientSession() as s:
async with s.get("https://api.brizahub.com/v1/me", headers=HEADERS) as r:
print(await r.json())
asyncio.run(main())const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const r = await fetch("https://api.brizahub.com/v1/me", { headers: { Authorization: `Bearer ${BRIZA_KEY}` } });
console.log(await r.json());<?php
$BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
$ch = curl_init('https://api.brizahub.com/v1/me');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $BRIZA_KEY],
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);{
"ok": true,
"platform": {
"id": 3,
"name": "@MySaver_bot",
"bot": "MySaver_bot",
"status": "active",
"webhook": null,
"token": false
},
"stats": {
"issued_today": 120,
"done_today": 41,
"done_total": 3050,
"left_total": 72
}
}GET/v1/stats
إحصاءات يومية (UTC).
المعاملات
daysintegerاختياري1–90 (الأكثر يُقلَّص إلى 90)، الافتراضي 7.
حقول الرد
daysarrayصف لكل يوم.
مثال
curl -s "https://api.brizahub.com/v1/stats?days=7" \
-H "Authorization: Bearer your_key_here"import asyncio
import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
async def main():
async with aiohttp.ClientSession() as s:
async with s.get("https://api.brizahub.com/v1/stats?days=7", headers=HEADERS) as r:
print(await r.json())
asyncio.run(main())const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const r = await fetch("https://api.brizahub.com/v1/stats?days=7", { headers: { Authorization: `Bearer ${BRIZA_KEY}` } });
console.log(await r.json());<?php
$BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
$ch = curl_init('https://api.brizahub.com/v1/stats?days=7');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $BRIZA_KEY],
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);{
"ok": true,
"days": [
{
"date": "2026-11-08",
"issued": 412,
"completed": 97,
"left": 6,
"earned": "1.55"
}
]
}GET/v1/balance
الأرباح، USDT.
بلا معاملات.
حقول الرد
balanceobjectavailable— قابل للسحب،pending— ينتظر 24 ساعة،paid— المدفوع،requested— في الطلبات.min_payoutstringالحد الأدنى للسحب، USDT.
مثال
curl -s "https://api.brizahub.com/v1/balance" \
-H "Authorization: Bearer your_key_here"import asyncio
import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
async def main():
async with aiohttp.ClientSession() as s:
async with s.get("https://api.brizahub.com/v1/balance", headers=HEADERS) as r:
print(await r.json())
asyncio.run(main())const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const r = await fetch("https://api.brizahub.com/v1/balance", { headers: { Authorization: `Bearer ${BRIZA_KEY}` } });
console.log(await r.json());<?php
$BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
$ch = curl_init('https://api.brizahub.com/v1/balance');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $BRIZA_KEY],
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);{
"ok": true,
"balance": {
"available": "12.4",
"pending": "1.06",
"total": "40.2",
"paid": "27.8",
"requested": "0"
},
"min_payout": "5"
}جرّب
«إرسال» طلب حقيقي بمفتاحك.
كود الطلب
curl -s -X POST "https://api.brizahub.com/v1/tasks" \
-H "Authorization: Bearer your_key_here" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"smart_links": true,
"mini_apps": true
}'import asyncio
import aiohttp
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
async def main():
async with aiohttp.ClientSession() as s:
async with s.post("https://api.brizahub.com/v1/tasks", headers=HEADERS, json={
"user_id": 123456789,
"smart_links": True,
"mini_apps": True,
}) as r:
print(await r.json())
asyncio.run(main())const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const r = await fetch("https://api.brizahub.com/v1/tasks", {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
user_id: 123456789,
smart_links: true,
mini_apps: true,
}),
});
console.log(await r.json());<?php
$BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
$ch = curl_init('https://api.brizahub.com/v1/tasks');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 123456789,
'smart_links' => true,
'mini_apps' => true,
]),
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);POST /v1/tasks HTTP/1.1
Host: api.brizahub.com
Authorization: Bearer your_key_here
Content-Type: application/json
{
"user_id": 123456789,
"smart_links": true,
"mini_apps": true
}الروابط الذكية والنقرات
- الرابط الذكي هو رابط المهمة عبر تطبيقنا المصغّر في تيليجرام (
t.me/BrizaAI?startapp=s_…): لا يغادر المستخدم تيليجرام، ويرى بطاقة القناة مع زر «اشترك» فيشترك، ونعرف جهازه وبلده. بعد أن نعرفه تأتي مهامه بروابط مباشرة لمدة 30 يومًا؛ ولبعض البوتات الرابط الذكي دائمًا. النقرات إلى المواقع أيضًا عبر التطبيق المصغّر (t.me/BrizaAI?startapp=c_…): تُحتسب النقرة عندما يضغط المستخدم «فتح» — يؤكد تيليجرام أن الحساب حقيقي. الروابط القديمة…/s/<code>تعمل. اعرضlinkكما هو. - ننصح بتفعيله —
"smart_links": true: تصلك نقرات على المواقع (النوعlink، الدفع فوري) وطلبات مستهدفة حسب الجهاز. معلنون أكثر — أرباح أكثر. بدونه — روابط مباشرة فقط للقنوات والمجموعات والبوتات. - اكتب على أزرار النقرات عنوانًا عامًا، مثل «🎁 عرض»، لا اسم الموقع.
ويب هوك بدل الاستعلام المتكرر
- حدّد عنوان
https://عامًا في @BrizaHubBot ← «بيع الترافيك» ← بوتك ← «API» ← «ويب هوك». انسخ سرّ التوقيع بزر «نسخ السرّ»، و«إعادة إصدار السرّ» يستبدله. task.pending— اشترك، الدفع بعد 24 ساعة؛task.completed— تم الدفع؛task.left— غادر مبكرًا، لا دفع. الحقول:event_id(نفسه عند التكرار)،task_id،user_id،via(check،join،infer،click)،at.- التوقيع —
X-Briza-Signature: sha256=<hex>: HMAC-SHA256 على<X-Briza-Timestamp>.<body>(بايتات الجسم الخام كما وصلت)، والمفتاح سرّك كاملًا معwhsec_. قارن السلسلة كاملة معsha256=؛ ارفض timestamp الأقدم من 5 دقائق. - التسليم: أجب بأي رمز
2xxخلال 5 ثوانٍ — لا نقرأ جسم الرد؛ أي شيء آخر (3xx، 4xx، 5xx، انتهاء المهلة) يُعد فشلًا. نعيد المحاولة حتى 8 مرات: بعد 30 ث، 2، 10، 30 دقيقة، 2، 6 و12 ساعة — آخر محاولة بعد نحو 21 ساعة من الحدث، ثم نتخلى عنه (تبقى الحالة في/v1/tasks/check). لكل إعادة نفسevent_id— عالجه مرة واحدة. تصل أحداث البوت الواحد بالترتيب، لكن الحدث الفاشل قد يصل بعد أحداث أحدث. لا نرسل ما دام البوت متوقفًا أو محظورًا؛ نتخلى عن الأحداث الأقدم من 24 ساعة. حتى 20 حدثًا لكل بوت كل 5 ثوانٍ؛ زر الاختبار — مرة في الدقيقة.
import hashlib
import hmac
import time
WEBHOOK_SECRET = "whsec_your_secret" # @BrizaHubBot → your bot → API → Webhook → Copy secret
def briza_signature_ok(headers, raw_body: bytes) -> bool:
"""raw_body — the request body exactly as received (bytes), not re-serialized JSON."""
ts = headers.get("X-Briza-Timestamp", "")
expected = "sha256=" + hmac.new(WEBHOOK_SECRET.encode(), ts.encode() + b"." + raw_body,
hashlib.sha256).hexdigest()
fresh = ts.isdigit() and abs(time.time() - int(ts)) < 300 # older than 5 minutes — reject
return fresh and hmac.compare_digest(expected, headers.get("X-Briza-Signature", ""))import crypto from "node:crypto";
const WEBHOOK_SECRET = "whsec_your_secret"; // @BrizaHubBot → your bot → API → Webhook → Copy secret
// rawBody — the request body exactly as received (Buffer), not re-serialized JSON
export function brizaSignatureOk(headers, rawBody) {
const ts = String(headers["x-briza-timestamp"] ?? "");
const expected = "sha256=" + crypto.createHmac("sha256", WEBHOOK_SECRET)
.update(`${ts}.`).update(rawBody).digest("hex");
const got = String(headers["x-briza-signature"] ?? "");
const fresh = /^\d+$/.test(ts) && Math.abs(Date.now() / 1000 - Number(ts)) < 300; // older than 5 minutes — reject
return fresh && got.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
}<?php
const WEBHOOK_SECRET = 'whsec_your_secret'; // @BrizaHubBot → your bot → API → Webhook → Copy secret
// $rawBody = file_get_contents('php://input') — the body exactly as received
function briza_signature_ok(string $rawBody): bool {
$ts = $_SERVER['HTTP_X_BRIZA_TIMESTAMP'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $rawBody, WEBHOOK_SECRET);
$fresh = ctype_digit($ts) && abs(time() - (int)$ts) < 300; // older than 5 minutes — reject
return $fresh && hash_equals($expected, $_SERVER['HTTP_X_BRIZA_SIGNATURE'] ?? '');
}حالات المهام
| الحالة | المعنى | بوتك |
|---|---|---|
incomplete | لم يشترك بعد | أوقفه |
pending | اشترك أو أرسل طلب انضمام — الدفع لاحقًا (المشترك — بعد 24 ساعة) | مرّره |
completed | تم الدفع | مرّره |
unavailable | المهمة لم تعد متاحة، السبب في reason | مرّره |
الأخطاء والمهلات
الخطأ: {"ok": false, "error": "…"} مع رمز HTTP؛ عند 429 أعد المحاولة بعد Retry-After ثانية. المهلة: 3 ثوانٍ — لا رد، لا توقف المستخدم.
| HTTP | error |
|---|---|
| 400 | bad_json, bad_user_id, bad_task_ids, bad_is_premium, bad_has_photo, bad_first_name, bad_smart_links, bad_mini_apps, bad_min_price, bad_chat_id, bad_message |
| 401 | no_key — لا يوجد مفتاح; bad_key — مفتاح خاطئ — انسخه من @BrizaHubBot |
| 403 | paused — البوت متوقف مؤقتًا: لا مهام; banned — البوت أو الحساب محظور; read_only — مفتاح للقراءة فقط: لا مهام; on_review — البوت قيد المراجعة — يعمل المفتاح تلقائيًا بعد الموافقة; rejected — لم تتم الموافقة على البوت |
| 409 | no_token |
| 413 | too_large |
| 429 | rate_limited |
| 500 | internal |
بوت كامل
ضع BRIZA_KEY وBOT_TOKEN.
# pip install aiogram brizahub — a bot with force-sub from Briza Hub
import asyncio
from aiogram import Bot, Dispatcher, F
from aiogram.filters import CommandStart
from aiogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message
from brizahub import Briza
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here" # your bot's token from @BotFather
bot = Bot(BOT_TOKEN)
dp = Dispatcher()
briza = Briza(BRIZA_KEY, smart_links=True, mini_apps=True) # more advertisers: device-targeted orders, visits, mini apps
def block(sponsors) -> InlineKeyboardMarkup:
# a visit may go to another offer for this device — label it generically, not with the site's name
rows = [[InlineKeyboardButton(text="🎁 Offer" if s.type == "link" else s.title or "Subscribe", url=s.link)]
for s in sponsors]
rows.append([InlineKeyboardButton(text="✅ Check", callback_data="briza:check")])
return InlineKeyboardMarkup(inline_keyboard=rows)
@dp.message(CommandStart())
async def start(message: Message) -> None:
await message.answer("Hi! Send me a link and I will download the video.")
@dp.message(F.text)
async def work(message: Message) -> None:
photos = await bot.get_user_profile_photos(message.from_user.id, limit=1) # «photo only» orders pay more
sponsors = await briza.get_sponsors(message.from_user, has_photo=photos.total_count > 0)
if sponsors: # force-sub first; [] — let the user in
await message.answer("Join our sponsors to use the bot:", reply_markup=block(sponsors))
return
await message.answer("⏳ Downloading…") # your bot's real work
@dp.callback_query(F.data == "briza:check")
async def check(call: CallbackQuery) -> None:
if await briza.check_sponsors(call.from_user): # not joined yet
await call.answer("Please join all the channels first", show_alert=True)
return
await call.answer()
await call.message.edit_text("✅ Thank you! Now send me a link.")
if __name__ == "__main__":
dp.shutdown.register(briza.close)
asyncio.run(dp.start_polling(bot))# pip install aiogram aiohttp — a bot with force-sub from Briza Hub
import asyncio
import aiohttp
from aiogram import Bot, Dispatcher, F
from aiogram.filters import CommandStart
from aiogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message
BRIZA_KEY = "your_key_here" # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here" # your bot's token from @BotFather
BRIZA = "https://api.brizahub.com"
bot = Bot(BOT_TOKEN)
dp = Dispatcher()
shown: dict[int, list[str]] = {} # user_id → task_ids of the shown block (use Redis/DB in production)
photos: dict[int, bool] = {} # user_id → has a profile photo (asked once per user)
async def briza(path: str, payload: dict) -> dict | None:
try:
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=3)) as s:
async with s.post(BRIZA + path, json=payload, headers={"Authorization": f"Bearer {BRIZA_KEY}"}) as r:
return await r.json() if r.status == 200 else None
except (aiohttp.ClientError, TimeoutError):
return None # Briza did not answer: never hold the user because of us
async def has_photo(user_id: int) -> bool | None:
"""«Photo only» orders pay more. None — unknown, not sent."""
if user_id not in photos:
try:
photos[user_id] = (await bot.get_user_profile_photos(user_id, limit=1)).total_count > 0
except Exception:
return None
return photos[user_id]
async def sponsors_needed(message: Message) -> bool:
"""True — the force-sub block is shown."""
user = message.from_user
data = await briza("/v1/tasks", {
"user_id": user.id,
"language_code": user.language_code,
"is_premium": bool(user.is_premium),
"first_name": user.first_name,
"has_photo": await has_photo(user.id),
"smart_links": True, # more advertisers: device-targeted orders and visits
"mini_apps": True, # mini app tasks too
})
tasks = (data or {}).get("tasks", [])
if not tasks:
return False
shown[user.id] = [t["task_id"] for t in tasks]
# a visit may go to another offer for this device — label it generically, not with the site's name
rows = [[InlineKeyboardButton(text="🎁 Offer" if t["type"] == "link" else t["title"], url=t["link"])]
for t in tasks]
rows.append([InlineKeyboardButton(text="✅ Check", callback_data="briza:check")])
await message.answer("Join our sponsors to use the bot:", reply_markup=InlineKeyboardMarkup(inline_keyboard=rows))
return True
@dp.message(CommandStart())
async def start(message: Message) -> None:
await message.answer("Hi! Send me a link and I will download the video.")
@dp.message(F.text)
async def work(message: Message) -> None:
if await sponsors_needed(message): # force-sub first
return
await message.answer("⏳ Downloading…") # your bot's real work
@dp.callback_query(F.data == "briza:check")
async def check(call: CallbackQuery) -> None:
ids = shown.get(call.from_user.id, [])
data = await briza("/v1/tasks/check", {"user_id": call.from_user.id, "task_ids": ids}) if ids else None
if any(x["status"] == "incomplete" for x in (data or {}).get("results", [])):
await call.answer("Please join all the channels first", show_alert=True)
return
shown.pop(call.from_user.id, None)
await call.answer()
await call.message.edit_text("✅ Thank you! Now send me a link.")
if __name__ == "__main__":
asyncio.run(dp.start_polling(bot))// npm i grammy — a bot with force-sub from Briza Hub (Node.js 18+)
import { Bot, InlineKeyboard } from "grammy";
const BRIZA_KEY = "your_key_here"; // your key from @BrizaHubBot
const BOT_TOKEN = "your_bot_token_here"; // your bot's token from @BotFather
const BRIZA = "https://api.brizahub.com";
const bot = new Bot(BOT_TOKEN);
const shown = new Map(); // userId → task_ids of the shown block (use Redis/DB in production)
const photos = new Map(); // userId → has a profile photo (asked once per user)
async function briza(path, payload) {
try {
const r = await fetch(BRIZA + path, {
method: "POST",
headers: { Authorization: `Bearer ${BRIZA_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify(payload),
signal: AbortSignal.timeout(3000),
});
return r.ok ? await r.json() : null;
} catch {
return null; // Briza did not answer: never hold the user because of us
}
}
// «Photo only» orders pay more; undefined — unknown, not sent
async function hasPhoto(userId) {
if (!photos.has(userId)) {
try {
photos.set(userId, (await bot.api.getUserProfilePhotos(userId, { limit: 1 })).total_count > 0);
} catch {
return undefined;
}
}
return photos.get(userId);
}
async function sponsorsNeeded(ctx) {
const u = ctx.from;
const data = await briza("/v1/tasks", {
user_id: u.id,
language_code: u.language_code,
is_premium: !!u.is_premium,
first_name: u.first_name,
has_photo: await hasPhoto(u.id),
smart_links: true, // more advertisers: device-targeted orders and visits
mini_apps: true, // mini app tasks too
});
const tasks = data?.tasks ?? [];
if (tasks.length === 0) return false;
shown.set(u.id, tasks.map((t) => t.task_id));
const kb = new InlineKeyboard();
// a visit may go to another offer for this device — label it generically, not with the site's name
for (const t of tasks) kb.url(t.type === "link" ? "🎁 Offer" : t.title, t.link).row();
kb.text("✅ Check", "briza:check");
await ctx.reply("Join our sponsors to use the bot:", { reply_markup: kb });
return true;
}
bot.command("start", (ctx) => ctx.reply("Hi! Send me a link and I will download the video."));
bot.on("message:text", async (ctx) => {
if (await sponsorsNeeded(ctx)) return; // force-sub first
await ctx.reply("⏳ Downloading…"); // your bot's real work
});
bot.callbackQuery("briza:check", async (ctx) => {
const ids = shown.get(ctx.from.id) ?? [];
const data = ids.length ? await briza("/v1/tasks/check", { user_id: ctx.from.id, task_ids: ids }) : null;
if ((data?.results ?? []).some((x) => x.status === "incomplete")) {
return ctx.answerCallbackQuery({ text: "Please join all the channels first", show_alert: true });
}
shown.delete(ctx.from.id);
await ctx.answerCallbackQuery();
await ctx.editMessageText("✅ Thank you! Now send me a link.");
});
bot.start();<?php
// A Telegram bot on a webhook, no libraries: Telegram → this file → Briza Hub
const BRIZA_KEY = 'your_key_here'; // your key from @BrizaHubBot
const BOT_TOKEN = 'your_bot_token_here'; // your bot's token from @BotFather
const BRIZA = 'https://api.brizahub.com';
function briza(string $path, array $payload): ?array {
$ch = curl_init(BRIZA . $path);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . BRIZA_KEY, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
]);
$body = curl_exec($ch);
$ok = $body !== false && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200;
curl_close($ch);
return $ok ? json_decode($body, true) : null; // null: Briza did not answer — never hold the user
}
function tg(string $method, array $params): ?array {
$url = 'https://api.telegram.org/bot' . BOT_TOKEN . '/' . $method;
$r = @file_get_contents($url, false, stream_context_create(['http' => [
'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => json_encode($params),
]]));
return $r === false ? null : (json_decode($r, true)['result'] ?? null);
}
// «Photo only» orders pay more (cache it per user in production); null — unknown
function has_photo(int $userId): ?bool {
$r = tg('getUserProfilePhotos', ['user_id' => $userId, 'limit' => 1]);
return $r === null ? null : $r['total_count'] > 0;
}
$update = json_decode(file_get_contents('php://input'), true);
$msg = $update['message'] ?? null;
if ($msg && ($msg['text'] ?? '') === '/start') {
tg('sendMessage', ['chat_id' => $msg['chat']['id'], 'text' => 'Hi! Send me a link and I will download the video.']);
} elseif ($msg && isset($msg['text'])) {
$u = $msg['from'];
$data = briza('/v1/tasks', [
'user_id' => $u['id'],
'language_code' => $u['language_code'] ?? null,
'is_premium' => !empty($u['is_premium']),
'first_name' => $u['first_name'],
'has_photo' => has_photo($u['id']),
'smart_links' => true, // more advertisers: device-targeted orders and visits
'mini_apps' => true, // mini app tasks too
]);
$tasks = $data['tasks'] ?? [];
if ($tasks) { // force-sub first
file_put_contents(sys_get_temp_dir() . "/briza_{$u['id']}.json", json_encode(array_column($tasks, 'task_id')));
// a visit may go to another offer for this device — label it generically, not with the site's name
$rows = array_map(fn($t) => [['text' => $t['type'] === 'link' ? '🎁 Offer' : $t['title'], 'url' => $t['link']]],
$tasks);
$rows[] = [['text' => '✅ Check', 'callback_data' => 'briza:check']];
tg('sendMessage', ['chat_id' => $u['id'], 'text' => 'Join our sponsors to use the bot:',
'reply_markup' => ['inline_keyboard' => $rows]]);
} else {
tg('sendMessage', ['chat_id' => $u['id'], 'text' => '⏳ Downloading…']); // your bot's real work
}
} elseif (($update['callback_query']['data'] ?? '') === 'briza:check') {
$q = $update['callback_query'];
$file = sys_get_temp_dir() . "/briza_{$q['from']['id']}.json";
$ids = is_file($file) ? json_decode(file_get_contents($file), true) : [];
$data = $ids ? briza('/v1/tasks/check', ['user_id' => $q['from']['id'], 'task_ids' => $ids]) : null;
$left = array_filter($data['results'] ?? [], fn($x) => $x['status'] === 'incomplete');
if ($left) {
tg('answerCallbackQuery', ['callback_query_id' => $q['id'], 'show_alert' => true,
'text' => 'Please join all the channels first']);
} else {
@unlink($file);
tg('answerCallbackQuery', ['callback_query_id' => $q['id']]);
tg('editMessageText', ['chat_id' => $q['message']['chat']['id'], 'message_id' => $q['message']['message_id'],
'text' => '✅ Thank you! Now send me a link.']);
}
}# Your key from @BrizaHubBot
BRIZA_KEY="your_key_here"
# 1. Tasks for the force-sub block
curl -s https://api.brizahub.com/v1/tasks \
-H "Authorization: Bearer $BRIZA_KEY" -H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"language_code": "fa",
"is_premium": false,
"has_photo": true,
"first_name": "Ali",
"smart_links": true,
"mini_apps": true
}'
# smart_links, mini_apps — more advertisers: device-targeted orders, visits and mini apps
# → {"ok": true, "tasks": [{"task_id": "t_Qx3…", "type": "channel", "link": "https://t.me/+AbCdEf",
# "title": "Channel title", "price": "0.01955",
# "photo": "https://api.brizahub.com/photo/3f9c2a1b7d4e8f0a6c5b.jpg"}]} # photo — JPEG 320×320
# Empty — let the user in; otherwise show the tasks as buttons plus «✅ Check»
# 2. «Check» pressed: hold while any task is "incomplete"
curl -s https://api.brizahub.com/v1/tasks/check \
-H "Authorization: Bearer $BRIZA_KEY" -H "Content-Type: application/json" \
-d '{"user_id": 123456789, "task_ids": ["t_Qx3…"]}'
# → {"ok": true, "results": [{"task_id": "t_Qx3…", "status": "pending"}]} # pending — paid in 24 h, completed — paid
# 3. Your earnings
curl -s https://api.brizahub.com/v1/balance -H "Authorization: Bearer $BRIZA_KEY"تغييرات API
/v1 مستقر منذ 09.11.2026: إضافات متوافقة فقط — حقول ومعاملات اختيارية جديدة. التغييرات غير المتوافقة تأتي في /v2 ونعلن عنها هنا وفي @BrizaHub قبل 14 يومًا.
- 26.11.2026 — لكل مهمة الآن
photo: صورة القناة أو المجموعة أو البوت برابط منّا (https://api.brizahub.com/photo/…jpg، JPEG بحجم 320×320). إن لم توجد صورة، أو كان موقعًا أو مجلدًا — صورة بديلة بنمط تيليجرام و"photo_placeholder": true. حزمة بايثونbrizahub0.1.3:Sponsor.photo،Sponsor.photo_placeholder. - 23.11.2026 — الرابط الذكي إلى قناة أو مجموعة أو بوت أو مجلد أصبح تطبيقنا المصغّر في تيليجرام (
t.me/BrizaAI?startapp=s_…) بدلًا من صفحة…/s/…: بطاقة المورد مع زر «اشترك»، ولا يغادر المستخدم تيليجرام؛ تُحتسب عند الانضمام كالمعتاد. لبعض البوتات — دائمًا. اعرضlinkكما هو. أيضًا:limitأكثر من 10 يُقلَّص إلى 10 بدل400 bad_limit؛ وdaysفي /v1/stats كذلك، إلى 1–90. - 17.11.2026 —
"suspicious": trueفي ردود/v1/tasksو/v1/check— نظام مكافحة الاحتيال لدينا علّم هذا المستخدم؛ السببsuspiciousفي/v1/tasks/check— لا يُدفع. - 13.11.2026 — نوع مهمة جديد
app، تطبيق مصغّر لبوت (t.me/bot/app?startapp=…أوt.me/bot?startapp=…): بدون تحقق فقط، ونحتسبه مع المهمة المجاورة التي نتحقق منها. عنوان الزر الافتراضي «فتح»، وفي الكتلة الجاهزة يأخذbutton_url. لا تريد التطبيقات المصغّرة — استبعد موضوع الرعاة «تطبيقات مصغّرة». في/v1/tasks— فقط مع الحقل الاختياري الجديد"mini_apps": true. - 11.11.2026 — نوع مهمة جديد
folder، مجلد (t.me/addlist/…): يضيفه الشخص بضغطة واحدة، ونحتسبه عبر إحدى قنواته. عنوان الزر الافتراضي «إضافة مجلد»؛ اعرض أي نوع غير معروف مثلchannel. لا تريد المجلدات — استبعد موضوع الرعاة «مجلدات». - 10.11.2026 —
messageفي/v1/check: نص حتى 4096 حرفًا، وHTML أو MarkdownV2 أوentities، ورموز تعبيرية مميزة، و$name، وأيقونات مميزة وألوان للأزرار. حزمة بايثونpip install brizahub. - 10.11.2026 — مهام النقر (
type: link) تفتح الآن تطبيقنا المصغّر في تيليجرام (t.me/BrizaAI?startapp=c_…)؛ تُحتسب النقرة عندما يضغط المستخدم «فتح». اعرضlinkكما هو. - 10.11.2026 — يصل مفتاح API مع الطلب مباشرة: حتى الموافقة
403 on_review، وعند الرفضrejected. الربط عبر رابط البوت بدون توكن: كل شيء عدا/v1/check. حقول جديدةhas_photoوfirst_name؛ ونتحقق منlanguage_codeوis_premiumوhas_photoبعد الاشتراك. - 09.11.2026 — مفتاح للقراءة فقط (
bzr_…)، الخطأread_only، الحقلread_onlyفي/v1/me. - 09.11.2026 — حالات مع الدفع:
incomplete(أوقفه)،pending(اشترك، الدفع بعد 24 ساعة)،completed(تم الدفع)، السببnot_paid؛ ويب هوكtask.pendingوtask.completedوtask.left.smart_links— هل تأخذ مهامًا بروابط ذكية./v1/check: كتلة بلا «تحقق»، بلغةlanguage_code، خلال 2.5 ثانية. لاحقًا: السببremoved— حظرت القناة المستخدم فلا يمكنه الانضمام. - 09.11.2026 — أخطاء المفتاح
no_keyوbad_keyوpausedوbanned؛limitو«وقت إعادة ضبط القائمة» — افتراضيًا من إعدادات البوت؛ أُزيلتverifiedوexpires_atوrepeat_hours. - 08.11.2026 — أول نسخة من API.
مستعد لتربح من ترافيكك؟
اربط بوتك في @BrizaHubBot — يستغرق الأمر دقيقة.