├── README.md ├── account.txt ├── bot.py ├── message.txt └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # THIS TUTORIAL RUNNING NODE GAIANET + BOT AUTO CHAT AI GAIANET ! 2 | 3 | # JOIN GAIANET NODE : [https://gaianet.ai](https://gaianet.ai/reward?invite_code=RkZQWt) 4 | 5 | # TUTORIAL FULL VIDEO : https://youtu.be/OPMe2mQrqbA 6 | 7 | # TUTORIAL RUNNING NODE : 8 | 9 | In VPS or Local ubuntu : 10 | 11 | 1. Install Node : 12 | 13 | ``` 14 | curl -sSfL 'https://github.com/GaiaNet-AI/gaianet-node/releases/latest/download/install.sh' | bash 15 | ``` 16 | 2. After Done install. copy this : 17 | ``` 18 | source /root/.bashrc 19 | ``` 20 | or u can following this step : 21 | 22 | [SCREENSHOT](https://prnt.sc/fBcrgn7pis8q) 23 | 24 | Next , u can copy this : 25 | ``` 26 | gaianet init 27 | ``` 28 | After done all. u can start Node : 29 | ``` 30 | gaianet start 31 | ``` 32 | 33 | After that, add your Device ID and Node ID to the website. To find out the device id and node id. use this command : 34 | ``` 35 | gaianet info 36 | ``` 37 | 38 | # How to add a domain ? You can see the full video on our Youtube 39 | 40 | 41 | Uninstall / Delete Node : 42 | Stop Node : 43 | ``` 44 | gaianet stop 45 | ``` 46 | Delete Node : 47 | ``` 48 | curl -sSfL 'https://github.com/GaiaNet-AI/gaianet-node/releases/latest/download/uninstall.sh' | bash 49 | ``` 50 | 51 | # FOR USE BOT : 52 | 53 | - EDIT FILE IN : account.txt FORMATS : 54 | 55 | APIKEY|DOMAIN 56 | 57 | EXAMPLE : 58 | 59 | gaia-akwokow1921oaksdoaks|https://llama.gaia.domains/v1/chat/completions 60 | 61 | # DONT FORGET JOIN CHANNEL : 62 | [TELEGRAM](https://t.me/SHAREITHUB_COM) 63 | [YOUTUBE](https://www.youtube.com/channel/UCUvH2S-T6T_hc7DjxhVd28A/) 64 | 65 | 66 | -------------------------------------------------------------------------------- /account.txt: -------------------------------------------------------------------------------- 1 | apikey|domain 2 | apikey|domain 3 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import cloudscraper 2 | import json 3 | import random 4 | import time 5 | import threading 6 | import shareithub 7 | from shareithub import shareithub 8 | 9 | 10 | shareithub() 11 | # Membaca API Key dan URL API dari file account.txt (multi API support) 12 | api_accounts = [] 13 | with open('account.txt', 'r') as file: 14 | for line in file: 15 | parts = line.strip().split('|') # Format: API_KEY|API_URL 16 | if len(parts) == 2: 17 | api_accounts.append((parts[0], parts[1])) 18 | 19 | if not api_accounts: 20 | print("Error: Tidak ada API Key dan URL yang valid di account.txt!") 21 | exit() 22 | 23 | # Membaca pesan-pesan pengguna dari file message.txt 24 | with open('message.txt', 'r') as file: 25 | user_messages = [msg.strip() for msg in file.readlines() if msg.strip()] 26 | 27 | if not user_messages: 28 | print("Error: Tidak ada pesan dalam message.txt!") 29 | exit() 30 | 31 | # Inisialisasi Cloudscraper 32 | scraper = cloudscraper.create_scraper() 33 | 34 | # Fungsi untuk mengirim permintaan ke API 35 | def send_request(message): 36 | while True: 37 | # Pilih API key dan URL secara acak 38 | api_key, api_url = random.choice(api_accounts) 39 | 40 | headers = { 41 | 'Authorization': f'Bearer {api_key}', 42 | 'Accept': 'application/json', 43 | 'Content-Type': 'application/json' 44 | } 45 | 46 | data = { 47 | "messages": [ 48 | {"role": "system", "content": "You are a helpful assistant."}, 49 | {"role": "user", "content": message} 50 | ] 51 | } 52 | 53 | try: 54 | response = scraper.post(api_url, headers=headers, json=data) 55 | 56 | # Cek status code dan pastikan respons tidak kosong 57 | if response.status_code == 200: 58 | try: 59 | response_json = response.json() 60 | print(f"✅ [SUCCESS] API: {api_url} | Message: '{message}'") 61 | print(response_json) 62 | break # Keluar dari loop jika berhasil 63 | except json.JSONDecodeError: 64 | print(f"⚠️ [ERROR] Invalid JSON response! API: {api_url}") 65 | print(f"Response Text: {response.text}") 66 | else: 67 | print(f"⚠️ [ERROR] API: {api_url} | Status: {response.status_code} | Retrying in 2s...") 68 | time.sleep(2) 69 | 70 | except Exception as e: 71 | print(f"❌ [REQUEST FAILED] API: {api_url} | Error: {e} | Retrying in 5s...") 72 | time.sleep(2) 73 | 74 | # Fungsi untuk menjalankan thread 75 | def start_thread(): 76 | while True: 77 | random_message = random.choice(user_messages) 78 | send_request(random_message) 79 | 80 | # Menentukan jumlah thread yang akan digunakan 81 | try: 82 | num_threads = int(input("Enter the number of threads you want to use: ")) 83 | if num_threads < 1: 84 | print("Please enter a number greater than 0.") 85 | exit() 86 | except ValueError: 87 | print("Invalid input. Please enter an integer.") 88 | exit() 89 | 90 | # Memulai multi-threading untuk pengiriman pesan acak 91 | threads = [] 92 | for _ in range(num_threads): 93 | thread = threading.Thread(target=start_thread, daemon=True) # Menggunakan daemon agar bisa dihentikan dengan CTRL+C 94 | threads.append(thread) 95 | thread.start() 96 | 97 | # Menunggu hingga semua thread selesai (script akan terus berjalan) 98 | for thread in threads: 99 | thread.join() 100 | 101 | print("All requests have been processed.") # (Ini tidak akan pernah tercapai karena looping terus menerus) 102 | -------------------------------------------------------------------------------- /message.txt: -------------------------------------------------------------------------------- 1 | paste your message here 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cloudscraper 2 | shareithub 3 | --------------------------------------------------------------------------------