Compare commits

..

3 Commits

Author SHA1 Message Date
Hash Borgir
18b5e37fd9 Added installer script. Fixed simplematrixbotlib stability issue in api.py 2024-02-12 19:49:00 -07:00
Hash Borgir
2a6cbecd28 Added installer script. Fixed simplematrixbotlib stability issue in api.py 2024-02-12 19:48:09 -07:00
Hash Borgir
8e20436570 Fixing stability bug in api.py 2024-02-12 18:15:16 -07:00
5 changed files with 96 additions and 4 deletions

3
.gitignore vendored
View File

@ -2,7 +2,8 @@
.gitignore
karma.db
proxies.db
proxy_lists/
session.txt
socks5.txt
venv/
plugins/__pycache__/
simplematrixbotlib/

View File

@ -0,0 +1,32 @@
From 4aa5b913f75e32f6ed06fc6e691daa856824b26a Mon Sep 17 00:00:00 2001
From: Hash Borgir <atirjavid@gmail.com>
Date: Mon, 12 Feb 2024 19:12:05 -0700
Subject: [PATCH] Fixed stability issue in api.py
---
simplematrixbotlib/api.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/simplematrixbotlib/api.py b/simplematrixbotlib/api.py
index 1d87b3d..13a78cf 100644
--- a/simplematrixbotlib/api.py
+++ b/simplematrixbotlib/api.py
@@ -295,6 +295,7 @@ class Api:
pass # Successful upload
else:
print(f"Failed Upload Response: {resp}")
+ return
content = {
"body": os.path.basename(image_filepath),
@@ -342,6 +343,7 @@ class Api:
pass # Successful upload
else:
print(f"Failed Upload Response: {resp}")
+ return
content = {
"body": os.path.basename(video_filepath),
--
2.34.1

View File

@ -11,7 +11,16 @@ Matrix Bot is a Python-based chat bot designed to work with Matrix, an open netw
- Plugin system: Each command is implemented as a separate plugin module, allowing for easy customization and extension.
- Extensible: Users can add new commands by creating additional plugin modules.
## Installation
## Automatic Installation
1. `./install.sh` or `bash install.sh`
2. Set up environment variables:
Put your bot homeserver/user/pass in `.env` file
3. Launch the bot:
`python funguy.py`, or `chmod +x funguy.py`, then `./funguy.py`
## Manual Installation
1. Clone the repository:
`git clone https://git.stoned.io/hash/FunguyBot`
@ -29,7 +38,7 @@ MATRIX_PASS=""
```
4. Run the bot:
`python funguy.py`, or `chmod +x funguy.py`, then `./funguy.py` in the bot directory.
`python funguy.py`, or `chmod +x funguy.py`, then `./funguy.py`
## Usage

51
install.sh Executable file
View File

@ -0,0 +1,51 @@
#!/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'"

View File

@ -29,7 +29,6 @@ pytube==15.0.0
referencing==0.33.0
requests==2.31.0
rpds-py==0.17.1
simplematrixbotlib==2.10.3
toml==0.10.2
unpaddedbase64==2.1.0
urllib3==2.2.0