# Webhook من تيليجرام

{% hint style="success" %}
**ما هو الويب هوك؟**&#x20;

هذا إشعار بخصوص حدث قد وقع. يحتوي هذا الإشعار على قيم المتغيرات التي تم تغييرها.
{% endhint %}

## كيف أحصل على الويب هوك؟

للحصول على ويب هوك كامل من تيليجرام، يكفي تعيين <mark style="color:red;">**أي قيمة إلى**</mark>**&#x20;save\_webhook** <mark style="color:red;">**المتغير:**</mark>

مثال `save_webhook = 'text value'`

<div data-with-frame="true"><figure><img src="/files/6b2cc04181ed19342a95c53cfc989d8a36590ff6" alt="" width="563"><figcaption></figcaption></figure></div>

مثال: قيمة متغير رقمية

<div data-with-frame="true"><figure><img src="/files/c4a4d9a662e6384b955cd6bcf05c137f72787947" alt="" width="563"><figcaption></figcaption></figure></div>

يمكن أن يكون المتغير save\_webhook إما ثابتًا في المشروع أو متغيرًا في الحاسبة (الأمثلة أعلاه):

<div data-with-frame="true"><figure><img src="/files/989c8f091aa8e54f61d147601ae891bbbf74f396" alt="" width="563"><figcaption></figcaption></figure></div>

في هذه الحالة، سيتم تسجيل رد العميل على رسالة البوت، التي تحتوي على مثل هذا المتغير، في متغير تيليجرام **tg\_request،** والذي يمكنك العثور عليه في بطاقة العميل ضمن متغيرات المعاملة.

<div data-with-frame="true"><figure><img src="/files/80bb1957e63a0be18dea75babd169985ae5e1bed" alt="" width="375"><figcaption></figcaption></figure></div>

استجاب العميل لرسالة البوت من الكتلة التي يتم فيها تعيين المتغير save\_webhook.

tg\_request و save\_webhook في متغير العميل

<div data-with-frame="true"><figure><img src="/files/1838f0f66646cfdf52514d11fc97d01b898e0759" alt="" width="563"><figcaption></figcaption></figure></div>

## كيف أحصل على رابط وسائط باستخدام متغير؟

يمكنك استخدام `tg_request` دالة للحصول على رابط تنزيل مباشر لفيديو أو صورة أو حركة متحركة أرسلها المستخدم.

**خطوات التنفيذ:**

1. **إعداد متغير الويب هوك:**\
   أولًا، عيّن أي قيمة لمتغير باسم `save_webhook`. يمكنك تعريف هذا كـ **ثابت مشروع** أو **متغير داخل كتلة Calculator**.
2. **إنشاء كتلة Trigger:**\
   بعد ذلك، أنشئ **كتلة مُشغِّل**. ستستمع هذه الكتلة إلى الوسائط الواردة وتستخدم `tg_request` الدالة مع `save_webhook` المتغير الخاص بك لالتقاط رابط الملف.

<div data-with-frame="true"><figure><img src="/files/b8e5a97271faf7fbc0634667f77fcaee5f36b978" alt="" width="563"><figcaption></figcaption></figure></div>

* بعد ذلك، أنشئ كتلة لإخراج النتيجة.

<div data-with-frame="true"><figure><img src="/files/00e032389bf0a42dc0567a1c02aebc8d8c874d31" alt="" width="563"><figcaption></figcaption></figure></div>

اتبع هذه الخطوات للحصول على رابط مباشر لملف من البوت الخاص بك:

1. **اذهب إلى بوت تيليجرام المتصل بك** وابدأ محادثة.
2. **اكتب الكلمة المفتاحية المخصصة لك** لتفعيل وظيفة طلب الملف.
3. **أرسل الملف** (صورة، فيديو، إلخ) الذي تريد الحصول على رابط تنزيله.

<div data-with-frame="true"><figure><img src="/files/75b8af63fcadc3e820c09381ec5766253a31281a" alt="" width="563"><figcaption></figcaption></figure></div>

انتبه إلى آخر file\_id في استجابة تيليجرام المستلمة:

<div data-with-frame="true"><figure><img src="/files/b331b8f0aebd2fb5947b19e3175670919d7913b9" alt=""><figcaption></figcaption></figure></div>

لا تنسَ أن الرابط المستلم صالح فقط ضمن إطار عمل البوت الذي أرسلت إليه الملف.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/doc/ar/chatbot/ttbyqat-almraslh/tylyjram/webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
