-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Continuous Integration
committed
Oct 27, 2023
1 parent
54dbbc8
commit c5f8b6d
Showing
4 changed files
with
238 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,83 @@ | ||
# ChatGPT خط بوت | ||
|
||
* [الإنجليزية](README.md) | ||
* [README.zh-TW.md](README.zh-TW.md) بنسخة تقليدية صينية | ||
* [الصينية المبسطة](README.zh-CN.md) | ||
* [الفرنسية](README.French.md) | ||
* [English](README.md) | ||
* [繁體中文版README.md](README.zh-TW.md) | ||
* [简体中文](README.zh-CN.md) | ||
* [Française](README.French.md) | ||
* [عربى](README.Arabic.md) | ||
|
||
هذا المشروع سيعلمك كيفية إنشاء **خط بوت ChatGPT** مجاني! | ||
|
||
## مقدمة | ||
## 介紹 | ||
|
||
يمكنك استيراد بوت ChatGPT في Line عن طريق إدخال النص مباشرة في مربع الإدخال. | ||
في Line ، يمكنك استيراد ChatGPT Bot ببساطة عن طريق إدخال النص في مربع الإدخال لبدء التفاعل مع ChatGPT. | ||
|
||
<img src="img/2023-10-25-10-03-47.png" width="30%" /> | ||
|
||
## الأدوات والميزات | ||
## 工具與特色 | ||
|
||
* `Python FastAPI`: إنشاء استجابة API لـ ChatGPT | ||
* `gpt4free`: **استخدام مجاني لواجهة برمجة التطبيقات من OpenAI** | ||
* `قناة واجهة رسائل Line`: تكامل مع واجهة برمجة التطبيقات لـ ChatGPT | ||
* `Python FastAPI`: إنشاء استجابة ChatGPT API | ||
* `gpt4free`: **استخدام OpenAI API مجانًا** | ||
* `قناة Line messaging API`: ربط ChatGPT API | ||
* `Github`: تخزين الشيفرة | ||
* `replit`: **نشر FastAPI الخاص بك مجانًا** | ||
* `CronJob`: إرسال طلبات بشكل دوري مجانًا لتجنب انقطاع واجهة البرمجة | ||
* `CronJob`: إرسال طلبات منتظمة مجانًا لتجنب انقطاع الاتصال | ||
|
||
## خطوات التثبيت | ||
## 安裝步驟 | ||
|
||
### الحصول على الرمز المميز (Token) | ||
### Token 取得 | ||
|
||
1. الحصول على رمز مميز Line: | ||
1. تسجيل الدخول إلى [مطوري Line](https://developers.line.biz/zh-hant/) | ||
1. الحصول على رمز Line: | ||
1. تسجيل الدخول إلى [Line Developer](https://developers.line.biz/zh-hant/) | ||
2. إنشاء روبوت: | ||
1. إنشاء "مزود" -> انقر فوق "إنشاء" | ||
2. إنشاء "قناة" -> حدد "إنشاء واجهة برمجة التطبيقات للرسائل" | ||
1. إنشاء `موفر` -> انقر فوق `Create` | ||
2. إنشاء `قناة` -> اختر `Create a Messaging API channel` | ||
3. أدخل المعلومات الأساسية المطلوبة | ||
4. بعد الانتهاء من الإدخال، يتواجد في الأسفل تحت "الإعدادات الأساسية" "الرمز السري للقناة" -> انقر فوق "الإصدار"، وهو يصبح بمثابة "LINE_CHANNEL_SECRET" (ستحتاج إليه لاحقًا) | ||
5. في "واجهة برمجة التطبيقات للرسائل" أسفل "واجهة البرمجة" هناك "رمز الوصول للقناة" -> انقر فوق "الإصدار"، وهو يصبح بمثابة "LINE_CHANNEL_ACCESS_TOKEN" (ستحتاج إليه لاحقًا) | ||
|
||
### إعداد المشروع | ||
1. استنسخ مستودع Github: | ||
1. سجّل الدخول/سجّل حسابًا في [GitHub](https://github.com/) | ||
2. انتقل إلى [ChatGPT-Line-Bot](https://github.com/Lin-jun-xiang/ChatGPT-Line-Bot) | ||
3. انقر على "النجمة" لدعم المطور | ||
4. انقر على "استنساخ" لنسخ جميع شيفرة المشروع إلى مستودعك الخاص | ||
2. نشر (مساحة مجانية): | ||
1. انتقل إلى [replit](https://replit.com/) | ||
2. انقر على "التسجيل" وسجّل الدخول بحساب "GitHub" الخاص بك وقم بمنح التصريح -> انقر على "تخطي" لتخطي إعدادات البداية | ||
3. بعد الدخول، انقر على "إنشاء" في الوسط على الصفحة الرئيسية وسيظهر مربعًا، انقر فوق "استيراد من GitHub" في الزاوية اليمنى العلوية | ||
4. إذا لم تكن قد أضفت مستودع GitHub بعد، فانقر على "الاتصال بـGitHub لاستيراد المستودعات الخاصة الخاصة بك." -> حدد "حدد مستودعات فقط" -> حدد "ChatGPT-Line-Bot" | ||
5. عد إلى الخطوة الرابعة، في هذا الوقت "عنوان GitHub" يمكن أن تختار مشروع "ChatGPT-Line-Bot" -> انقر على "استيراد من GitHub". | ||
|
||
### تشغيل المشروع | ||
1. إعداد متغيرات البيئة | ||
1. بعد الانتهاء من الخطوة السابقة "الاستيراد" في "Replit"، انتقل إلى صفحة إدارة المشروع على اليسار أسفل "الأدوات" وانقر على "الأسرار". | ||
2. بعد النقر على "استلامتم" على اليمين، يمكنك إضافة متغيرات ب | ||
4. بعد الانتهاء من الإدخال ، في الجزء السفلي من "الإعدادات الأساسية" ، هناك "سر القناة" -> انقر فوق "Issue" ، وسيتم إنشاء "LINE_CHANNEL_SECRET" بعد ذلك (سيتم استخدامه في وقت لاحق) | ||
5. في "واجهة برمجة التطبيقات الرسائل" ، هناك "رمز الوصول للقناة" -> انقر فوق "Issue" ، وسيتم إنشاء "LINE_CHANNEL_ACCESS_TOKEN" بعد ذلك (سيتم استخدامه في وقت لاحق) | ||
|
||
### 專案設置 | ||
1. Fork Github 專案: | ||
1. التسجيل / تسجيل الدخول إلى [GitHub](https://github.com/) | ||
2. الانتقال إلى [ChatGPT-Line-Bot](https://github.com/Lin-jun-xiang/ChatGPT-Line-Bot) | ||
3. انقر على `Star` لدعم المطور | ||
4. انقر على `Fork` لنسخ جميع الشفرة إلى السجل الخاص بك | ||
2. النشر (مساحة مجانية): | ||
1. الانتقال إلى [replit](https://replit.com/) | ||
2. انقر على "Sign Up" وقم بتسجيل الدخول باستخدام حسابك في `Github` والموافقة على الوصول -> انقر فوق "Skip" لتجاوز الإعداد الأولي | ||
3. بمجرد الوصول إلى الصفحة الرئيسية في الوسط ، انقر فوق "Create" -> ستظهر نافذة منبثقة ، انقر فوق "Import from Github" في الزاوية العلوية اليمنى | ||
4. إذا لم تكن قد قمت بإضافة مستودع Github بعد ، فانقر فوق الارتباط "Connect GitHub to import your private repos." -> حدد "Only select repositories" -> حدد "ChatGPT-Line-Bot" | ||
5. عد إلى الخطوة الرابعة ، وفي هذا الوقت يمكنك اختيار مشروع "Github URL" -> انقر فوق "Import from Github". | ||
|
||
### 專案執行 | ||
1. إعدادات المتغيرات البيئية | ||
1. بعد استكمال الخطوة السابقة "Import" ، انتقل إلى صفحة إدارة المشروع في "Replit" وانقر على "Tools" في الزاوية اليسرى السفلى للوصول إلى "Secrets". | ||
2. بعد النقر فوق الزر "Got it" في الجانب الأيمن ، يمكنك إضافة متغيرات البيئة ، ويجب إضافة: | ||
1. Line Channel Secret: | ||
- المفتاح: `LINE_CHANNEL_SECRET` | ||
- القيمة: `[الحصول من الخطوة الأولى]` | ||
2. Line Channel Access Token: | ||
- المفتاح: `LINE_CHANNEL_ACCESS_TOKEN` | ||
- القيمة: `[الحصول من الخطوة الأولى]` | ||
|
||
<img src="img/2023-10-25-10-00-59.png" width="60%"/> | ||
|
||
2. بدء التشغيل | ||
1. انقر فوق "Run" في الأعلى | ||
2. بعد النجاح ، ستظهر "Hello World" في الجزء العلوي الأيمن من الشاشة ، وقم بنسخ عنوان الويب الموجود في الأعلى | ||
3. اعود إلى Line Developer وفي "Messaging API" تحت "Webhook URL" ، قم بلصق العنوان الذي قمت بنسخه في الخطوة السابقة وأضف "/callback" مثل: `https://ChatGPT-Line-Bot.jimmylin.repl.co/callback` | ||
4. قم بتشغيل خيار "Use webhook" في الأسفل | ||
5. قم بإيقاف تشغيل "Auto-reply messages" في الأسفل | ||
- ملاحظة: إذا لم يتم تلقي أي طلب خلال ساعة واحدة ، سيتم إيقاف تشغيل البرنامج ، لذا يجب اتباع الخطوات التالية | ||
|
||
<img src="img/2023-10-25-10-01-21.png" width="60%"/> | ||
|
||
3. CronJob 定時發送請求 | ||
1. التسجيل / تسجيل الدخول إلى [cron-job.org](https://cron-job.org/en/) | ||
2. بعد الوصول إلى اللوحة ، انقر فوق "CREATE CRONJOB" في الزاوية العلوية اليمنى | ||
3. أدخل "Title" كـ "ChatGPT-Line-Bot" ، وأدخل عنوان الويب الذي قمت بنسخه في الخطوة السابقة ، على سبيل المثال: `https://ChatGPT-Line-Bot.jimmylin.repl.co/` | ||
4. في الأسفل ، قم بالنقر على الوقت "كل 5 دقائق" | ||
5. انقر فوق "CREATE" | ||
|
||
### 連結服務與 Line Bot | ||
|
||
العودة إلى [Line Developer](https://manager.line.biz/account) الصفحة الرئيسية وانقر فوق "دليل إضافة صديق |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.