FunguyBot/install.sh

52 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Store current directory
current_dir=$(pwd)
# Clone the simplematrixbotlib repository
git clone https://github.com/imbev/simplematrixbotlib.git
# Copy the patch file to the simplematrixbotlib directory
cp 0001-Fixed-stability-issue-in-api.py.patch $current_dir/simplematrixbotlib/
# Change directory to simplematrixbotlib
cd $current_dir/simplematrixbotlib/
# Apply the patch
git apply 0001-Fixed-stability-issue-in-api.py.patch
# Remove the patch file
rm 0001-Fixed-stability-issue-in-api.py.patch
# Install simplematrixbotlib
pip install .
# Change back to the original directory
cd $current_dir
# Install requirements
pip install -r requirements.txt
# Create .env file with required content
echo -e "MATRIX_URL = \"https://matrix.org\"\nMATRIX_USER = \"\"\nMATRIX_PASS = \"\"" > .env
# Print ASCII art
echo " _____ ____ _ "
echo "| ___| _ _ __ __ _ _ _ _ _ | __ ) ___ | |_ "
echo "| |_ | | | | '_ \ / _\` | | | | | | | | _ \ / _ \| __| "
echo "| _|| |_| | | | | (_| | |_| | |_| | | |_) | (_) | |_ "
echo "|_| \__,_|_| |_|\__, |\__,_|\__, | |____/ \___/ \__| "
echo " |___/ |___/ "
# Echo setup completion message
echo "Bot setup completed."
# Prompt user to modify funguy.py to set ADMIN_USER
echo "Modify .env file and set your credentials and homeserver"
echo "Please open funguy.py and set the ADMIN_USER variable to your admin username."
# Launch the bot
echo "Launch the bot with 'python funguy.py'"