mirror of
				https://github.com/cdryzun/tg_bot_collections.git
				synced 2025-11-04 16:56:43 +08:00 
			
		
		
		
	@ -1,2 +1,8 @@
 | 
				
			|||||||
Google_Gemini_API_Key="your_gemini_api_key"
 | 
					Google_Gemini_API_Key="your_gemini_api_key"
 | 
				
			||||||
Telegram_Bot_Token="your_telegram_bot_token"
 | 
					Telegram_Bot_Token="your_telegram_bot_token"
 | 
				
			||||||
 | 
					Anthropic_API_Key="your_anthropic_api_key"
 | 
				
			||||||
 | 
					Openai_API_Key="your_openai_api_key"
 | 
				
			||||||
 | 
					Yi_API_Key="your_yi_api_key"
 | 
				
			||||||
 | 
					Yi_Base_Url="your_yi_base_url"
 | 
				
			||||||
 | 
					Python_Bin_Path=""
 | 
				
			||||||
 | 
					Python_Venv_Path="venv"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										27
									
								
								setup.sh
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								setup.sh
									
									
									
									
									
								
							@ -1,6 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
python_bin_path="$(which python3)"
 | 
					python_bin_path="$(which python3)"
 | 
				
			||||||
 | 
					venv_dir="venv"
 | 
				
			||||||
project_path="$(pwd)"
 | 
					project_path="$(pwd)"
 | 
				
			||||||
service_name="tgbotyh"
 | 
					service_name="tgbotyh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -8,10 +9,11 @@ source .env
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
google_gemini_api_key="${Google_Gemini_API_Key}"
 | 
					google_gemini_api_key="${Google_Gemini_API_Key}"
 | 
				
			||||||
telegram_bot_token="${Telegram_Bot_Token}"
 | 
					telegram_bot_token="${Telegram_Bot_Token}"
 | 
				
			||||||
 | 
					anthropic_api_key="${Anthropic_API_Key}"
 | 
				
			||||||
 | 
					openai_api_key="${Openai_API_Key}"
 | 
				
			||||||
 | 
					yi_api_key="${Yi_API_Key}"
 | 
				
			||||||
 | 
					yi_base_url="${Yi_Base_Url}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -n "$Python_Venv_Path" ]; then
 | 
					 | 
				
			||||||
    venv_dir="${Python_Venv_Path}"
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -n "$Python_Bin_Path" ]; then
 | 
					if [ -n "$Python_Bin_Path" ]; then
 | 
				
			||||||
    python_bin_path="$Python_Bin_Path"
 | 
					    python_bin_path="$Python_Bin_Path"
 | 
				
			||||||
@ -21,10 +23,6 @@ if [ -n "$Python_Venv_Path" ]; then
 | 
				
			|||||||
    venv_dir="${Python_Venv_Path}"
 | 
					    venv_dir="${Python_Venv_Path}"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -n "$Python_Bin_Path" ]; then
 | 
					 | 
				
			||||||
    python_bin_path="$Python_Bin_Path"
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
sudoCmd=""
 | 
					sudoCmd=""
 | 
				
			||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
 | 
					if [[ $(/usr/bin/id -u) -ne 0 ]]; then
 | 
				
			||||||
  sudoCmd="sudo"
 | 
					  sudoCmd="sudo"
 | 
				
			||||||
@ -92,6 +90,12 @@ function installPythonVirtualEnv(){
 | 
				
			|||||||
    echo "Python bin path: $python_bin_path"
 | 
					    echo "Python bin path: $python_bin_path"
 | 
				
			||||||
    echo "Google_Gemini_API_Key: $Google_Gemini_API_Key"
 | 
					    echo "Google_Gemini_API_Key: $Google_Gemini_API_Key"
 | 
				
			||||||
    echo "Telegram Bot Token: $Telegram_Bot_Token"
 | 
					    echo "Telegram Bot Token: $Telegram_Bot_Token"
 | 
				
			||||||
 | 
					    echo "Anthropic API Key: $Anthropic_API_Key"
 | 
				
			||||||
 | 
					    echo "Openai API Key: $Openai_API_Key"
 | 
				
			||||||
 | 
					    echo "Yi API Key: $Yi_API_Key"
 | 
				
			||||||
 | 
					    echo "Yi Base Url: $Yi_Base_Url"
 | 
				
			||||||
 | 
					    echo "=============================="
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo
 | 
					    echo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Check Virtual Environment exist
 | 
					    # Check Virtual Environment exist
 | 
				
			||||||
@ -134,6 +138,11 @@ User=root
 | 
				
			|||||||
Group=root
 | 
					Group=root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Environment="GOOGLE_GEMINI_KEY=${google_gemini_api_key}"
 | 
					Environment="GOOGLE_GEMINI_KEY=${google_gemini_api_key}"
 | 
				
			||||||
 | 
					Environment="ANTHROPIC_API_KEY=${anthropic_api_key}"
 | 
				
			||||||
 | 
					Environment="OPENAI_API_KEY=${openai_api_key}"
 | 
				
			||||||
 | 
					Environment="YI_API_KEY=${yi_api_key}"
 | 
				
			||||||
 | 
					Environment="YI_BASE_URL=${yi_base_url}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WorkingDirectory=$project_path
 | 
					WorkingDirectory=$project_path
 | 
				
			||||||
ExecStart=$project_path/venv/bin/python $project_path/tg.py "${telegram_bot_token}"
 | 
					ExecStart=$project_path/venv/bin/python $project_path/tg.py "${telegram_bot_token}"
 | 
				
			||||||
@ -172,6 +181,10 @@ function installCommandLine(){
 | 
				
			|||||||
    echo
 | 
					    echo
 | 
				
			||||||
    echo "=============================="
 | 
					    echo "=============================="
 | 
				
			||||||
    export GOOGLE_GEMINI_KEY=$google_gemini_api_key
 | 
					    export GOOGLE_GEMINI_KEY=$google_gemini_api_key
 | 
				
			||||||
 | 
					    export ANTHROPIC_API_KEY=$anthropic_api_key
 | 
				
			||||||
 | 
					    export OPENAI_API_KEY=$openai_api_key
 | 
				
			||||||
 | 
					    export YI_API_KEY=$yi_api_key
 | 
				
			||||||
 | 
					    export YI_BASE_URL=$yi_base_url
 | 
				
			||||||
    python tg.py "${telegram_bot_token}"
 | 
					    python tg.py "${telegram_bot_token}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user