بارگذاری ... ...

فایل ها

File اتصال ساده به ربات تلگرام
محصور
<!DOCTYPE html> <html lang="fa" dir="rtl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="آموزش ساخت ربات تلگرام تولید محتوا با هوش مصنوعی Gemini و n8n. تحلیل گام‌به‌گام ورک‌فلو، معماری توکن‌ها و تاثیر بیزینسی این اتوماسیون."> <meta name="keywords" content="n8n, Gemini AI, Telegram Bot, اتوماسیون, هوش مصنوعی, سئو, Workflow JSON"> <meta name="author" content="Mojtaba Hemmati Sis"> <title>تحلیل و پیاده‌سازی ربات نویسنده هوشمند با n8n و Gemini</title> <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" /> <style> :root { --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --secondary-gradient: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); --accent-color: #764ba2; --text-dark: #2d3748; --text-light: #718096; --bg-color: #f7fafc; --card-bg: #ffffff; --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); --radius: 16px; } * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Vazirmatn', sans-serif; background-color: var(--bg-color); color: var(--text-dark); line-height: 1.8; overflow-x: hidden; } /* هدر جذاب با گرادینت */ header { background: var(--primary-gradient); color: white; padding: 80px 20px; text-align: center; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); margin-bottom: 40px; } header h1 { font-size: 2.5rem; margin-bottom: 10px; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.2); } header p { font-size: 1.2rem; opacity: 0.9; } .container { max-width: 1100px; margin: 0 auto; padding: 0 20px; } /* استایل کارت‌ها */ .card { background: var(--card-bg); border-radius: var(--radius); padding: 30px; margin-bottom: 30px; box-shadow: var(--shadow-sm); transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid rgba(0,0,0,0.02); position: relative; overflow: hidden; } .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); } .card::before { content: ''; position: absolute; top: 0; right: 0; width: 5px; height: 100%; background: var(--primary-gradient); } /* تایپوگرافی داخل محتوا */ h2 { color: var(--accent-color); margin-bottom: 20px; font-size: 1.8rem; border-bottom: 2px dashed #e2e8f0; padding-bottom: 10px; display: inline-block; } h3 { color: #4a5568; margin: 20px 0 10px; font-size: 1.4rem; } p { margin-bottom: 15px; color: #4a5568; text-align: justify; } /* استایل بخش مراحل (Workflow) */ .step-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; } .step-card { background: #fff; padding: 20px; border-radius: 12px; border-right: 4px solid #4fd1c5; /* Mint Green */ box-shadow: var(--shadow-sm); } .step-number { font-size: 3rem; font-weight: 900; color: #e6fffa; position: absolute; top: 10px; left: 20px; z-index: 0; } .step-content { position: relative; z-index: 1; } .badge { display: inline-block; padding: 5px 12px; background: var(--secondary-gradient); color: #234e52; border-radius: 20px; font-size: 0.8rem; font-weight: bold; margin-bottom: 10px; } /* کد بلاک‌ها */ .code-snippet { background: #2d3748; color: #a0aec0; padding: 15px; border-radius: 8px; font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; direction: ltr; margin: 10px 0; border-left: 4px solid #764ba2; } .highlight { color: #f687b3; } /* جدول توکن‌ها */ .token-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); } .token-table th, .token-table td { padding: 15px; text-align: right; border-bottom: 1px solid #e2e8f0; } .token-table th { background: #f7fafc; color: var(--accent-color); font-weight: bold; } .token-table tr:last-child td { border-bottom: none; } .token-table tr:hover { background-color: #fafffd; } /* بخش بیزینس */ .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; } .stat-box { text-align: center; padding: 20px; background: linear-gradient(135deg, #fff5f5 0%, #fff 100%); border-radius: 12px; border: 1px solid #fed7d7; } .stat-icon { font-size: 2rem; margin-bottom: 10px; display: block; } footer { text-align: center; padding: 40px; color: var(--text-light); font-size: 0.9rem; border-top: 1px solid #e2e8f0; margin-top: 50px; } /* دکمه CTA */ .cta-button { display: inline-block; background: var(--primary-gradient); color: white; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-weight: bold; box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4); transition: all 0.3s ease; } .cta-button:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6); } @media (max-width: 768px) { header h1 { font-size: 1.8rem; } .step-container { grid-template-columns: 1fr; } } </style> </head> <body> <header> <div class="container"> <h1>معماری ربات نویسنده هوشمند</h1> <p>تحلیل فنی و بیزینسی اتوماسیون تولید محتوا با n8n و Google Gemini</p> </div> </header> <main class="container"> <section class="card"> <h2>درباره این سیستم</h2> <p> فایل JSON ارائه شده، نقشه‌ی راه یک <strong>سیستم هوشمند تولید محتوای بلادرنگ (Real-time)</strong> است. این سیستم به عنوان یک پل ارتباطی بین پیام‌رسان محبوب تلگرام و مغز متفکر گوگل (Gemini AI) عمل می‌کند. هدف اصلی این ورک‌فلو، تبدیل یک درخواست ساده کاربری به یک مقاله کوتاه، سئو شده و ساختارمند به زبان فارسی است، بدون اینکه نیاز به دخالت انسانی باشد. </p> <div style="text-align: center; margin-top: 20px;"> <span class="badge">n8n Workflow</span> <span class="badge">Google PaLM/Gemini</span> <span class="badge">Telegram Bot API</span> </div> </section> <article> <div class="card"> <h2>۱. تحلیل گام‌به‌گام (The Workflow Anatomy)</h2> <p>این سیستم از ۴ گره (Node) حیاتی تشکیل شده است که داده‌ها را مانند خون در رگ‌های یک موجود زنده به جریان می‌اندازند.</p> <div class="step-container"> <div class="step-card"> <div class="step-number">01</div> <div class="step-content"> <h3>Telegram Trigger</h3> <span class="badge">شنونده (The Ear)</span> <p><strong>چرا هست؟</strong> برای شروع فرآیند نیاز به یک محرک داریم.</p> <p><strong>هدف:</strong> گوش دادن دائم به چت‌های تلگرام و دریافت پیام‌های جدید.</p> <p><strong>نحوه کار:</strong> از طریق `webhook` متصل می‌شود و به محض دریافت پیام، متن پیام (`message.text`) و شناسه چت (`chat.id`) را استخراج می‌کند.</p> </div> </div> <div class="step-card"> <div class="step-number">02</div> <div class="step-content"> <h3>Basic LLM Chain</h3> <span class="badge">منطق پردازش (The Logic)</span> <p><strong>چرا هست؟</strong> برای مدیریت ساختار پرامپت و اتصال مدل زبان.</p> <p><strong>هدف:</strong> تزریق دستورالعمل‌های "پرسونا" به مدل هوش مصنوعی.</p> <p><strong>نحوه کار:</strong> یک پرامپت مهندسی شده تعریف می‌کند: <em>"تو یک نویسنده ماهر مقالات فارسی هستی..."</em> و ورودی کاربر را به این دستورالعمل می‌چسباند.</p> </div> </div> <div class="step-card"> <div class="step-number">03</div> <div class="step-content"> <h3>Google Gemini Model</h3> <span class="badge">مغز متفکر (The Brain)</span> <p><strong>چرا هست؟</strong> برای تولید محتوای خلاقانه.</p> <p><strong>هدف:</strong> پردازش درخواست و تولید متن سئو شده.</p> <p><strong>نحوه کار:</strong> از `Google PaLM API` استفاده می‌کند. به عنوان مدل زبانی به زنجیره (Chain) متصل می‌شود تا متن نهایی را تولید کند.</p> </div> </div> <div class="step-card"> <div class="step-number">04</div> <div class="step-content"> <h3>Telegram Sender</h3> <span class="badge">گوینده (The Voice)</span> <p><strong>چرا هست؟</strong> برای تحویل نتیجه به کاربر.</p> <p><strong>هدف:</strong> ارسال پاسخ تولید شده به همان کاربری که سوال را پرسیده.</p> <p><strong>نحوه کار:</strong> از `chat.id` که در مرحله اول دریافت شده استفاده می‌کند و خروجی مدل (`$json.text`) را ارسال می‌کند.</p> </div> </div> </div> </div> </article> <section class="card" style="border-right: 5px solid #764ba2;"> <h2>۲. معماری توکن‌ها و امنیت (Credential Architecture)</h2> <p>برای اینکه این سیستم "زنده" شود، شما به کلیدهای امنیتی خاصی نیاز دارید. طبق فایل JSON، دو دسته اعتبارنامه (Credentials) ضروری است:</p> <table class="token-table"> <thead> <tr> <th>نام سرویس</th> <th>نام در n8n</th> <th>کاربرد</th> <th>چگونگی دریافت</th> </tr> </thead> <tbody> <tr> <td><strong>Telegram API</strong></td> <td><code>telegramApi</code></td> <td>اتصال به ربات برای دریافت و ارسال پیام.</td> <td>ایجاد ربات در <strong>BotFather@</strong> و دریافت توکن HTTP API.</td> </tr> <tr> <td><strong>Google PaLM/Gemini</strong></td> <td><code>googlePalmApi</code></td> <td>دسترسی به مدل هوش مصنوعی جمینای.</td> <td>دریافت API Key از کنسول <strong>Google AI Studio</strong>.</td> </tr> </tbody> </table> <br> <div class="code-snippet"> <span style="color: #63b3ed;">// نکته امنیتی مهم:</span><br> هرگز توکن‌ها را مستقیماً در نودها (Nodes) هاردکد نکنید. فایل JSON شما به درستی از سیستم مدیریت Credentials در n8n استفاده کرده است که امنیت را تضمین می‌کند. </div> </section> <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px;"> <section class="card"> <h2>۳. تأثیر بیزینسی (Business Impact)</h2> <p>این سیستم فقط یک کد نیست، بلکه یک ماشین <strong>خلق ارزش</strong> است. پیاده‌سازی این اتوماسیون تاثیرات عمیقی دارد:</p> <ul style="list-style: none; padding-right: 10px;"> <li style="margin-bottom: 15px;"> ✅ <strong>کاهش هزینه عملیاتی:</strong> حذف نیاز به نیروی انسانی برای پاسخگویی به سوالات متداول یا تولید محتوای پایه. </li> <li style="margin-bottom: 15px;"> ✅ <strong>مقیاس‌پذیری (Scalability):</strong> این سیستم می‌تواند همزمان به هزاران درخواست پاسخ دهد، کاری که یک انسان نمی‌تواند. </li> <li style="margin-bottom: 15px;"> ✅ <strong>تعامل ۲۴/۷:</strong> مشتریان شما در هر ساعت از شبانه روز پاسخ‌های تخصصی و سئو شده دریافت می‌کنند. </li> </ul> </section> <section class="card" style="background: linear-gradient(to bottom right, #ffffff, #f0fff4);"> <h2>۴. مهندسی پرامپت و سئو</h2> <p>در نود <code>Basic LLM Chain</code>، یک پرامپت هوشمندانه نهفته است:</p> <div class="code-snippet" style="background: #fff; color: #333; border: 1px solid #ddd; font-style: italic;"> "تو یک نویسنده ماهر مقالات فارسی هستی... با توجه به اصول مقاله نویسی و سئو پاسخ بده..." </div> <p style="margin-top: 15px;"> <strong>چرا این مهم است؟</strong> <br> این دستورالعمل تضمین می‌کند خروجی نهایی صرفاً یک "متن" نیست، بلکه محتوایی است که دارای ساختار، کلمات کلیدی و لحن مناسب برای موتورهای جستجو است. محدودیت ۵۰۰ کاراکتر نیز باعث می‌شود پاسخ‌ها برای مدیوم موبایل (تلگرام) مختصر و مفید (Bite-sized content) باشند. </p> </section> </div> <section class="card" style="text-align: center;"> <h2>نتیجه‌گیری نهایی</h2> <p>این فایل JSON یک نمونه عالی از معماری میکروسرویس در بستر Low-code است. با ترکیب سرعت تلگرام و هوش Gemini، ما یک ابزار قدرتمند برای تولید محتوا و پشتیبانی مشتری ساخته‌ایم که هم از نظر فنی پایدار است و هم از نظر اقتصادی توجیه‌پذیر.</p> <a href="#" class="cta-button">شروع پیاده‌سازی در n8n</a> </section> </main> <footer> <p>طراحی و تحلیل توسط توسعه‌دهنده و متخصص محتوا | © 2025</p> </footer> </body> </html>
اندازه فایل: هیچکدام