simplematrixbotlib updated to 2.10 from codeberg
This commit is contained in:
parent
df87d39e82
commit
8c23deb13b
14
install.sh
14
install.sh
@ -3,21 +3,15 @@
|
|||||||
# Store current directory
|
# Store current directory
|
||||||
current_dir=$(pwd)
|
current_dir=$(pwd)
|
||||||
|
|
||||||
# Clone the simplematrixbotlib repository
|
# Load venv
|
||||||
git clone https://github.com/imbev/simplematrixbotlib.git
|
source venv/bin/activate
|
||||||
|
|
||||||
# Copy the patch file to the simplematrixbotlib directory
|
# Clone the simplematrixbotlib repository
|
||||||
cp 0001-Fixed-stability-issue-in-api.py.patch $current_dir/simplematrixbotlib/
|
git clone https://codeberg.org/imbev/simplematrixbotlib.git
|
||||||
|
|
||||||
# Change directory to simplematrixbotlib
|
# Change directory to simplematrixbotlib
|
||||||
cd $current_dir/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
|
# Install simplematrixbotlib
|
||||||
pip install .
|
pip install .
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# plugins/llm.py
|
# plugins/ai-music.py
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
@ -7,7 +7,7 @@ import simplematrixbotlib as botlib
|
|||||||
|
|
||||||
async def handle_command(room, message, bot, PREFIX):
|
async def handle_command(room, message, bot, PREFIX):
|
||||||
"""
|
"""
|
||||||
Function to handle the !gpt command.
|
Function to handle the !music command.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
room (Room): The Matrix room where the command was invoked.
|
room (Room): The Matrix room where the command was invoked.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# plugins/llm.py
|
# plugins/ai-tech.py
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
@ -7,7 +7,7 @@ import simplematrixbotlib as botlib
|
|||||||
|
|
||||||
async def handle_command(room, message, bot, PREFIX):
|
async def handle_command(room, message, bot, PREFIX):
|
||||||
"""
|
"""
|
||||||
Function to handle the !gpt command.
|
Function to handle the !funguy command.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
room (Room): The Matrix room where the command was invoked.
|
room (Room): The Matrix room where the command was invoked.
|
||||||
|
@ -5,6 +5,11 @@ import logging
|
|||||||
from pytube import YouTube
|
from pytube import YouTube
|
||||||
import simplematrixbotlib as botlib
|
import simplematrixbotlib as botlib
|
||||||
|
|
||||||
|
def seconds_to_minutes_seconds(seconds):
|
||||||
|
minutes = seconds // 60
|
||||||
|
seconds %= 60
|
||||||
|
return f"{minutes:02d}:{seconds:02d}"
|
||||||
|
|
||||||
async def handle_command(room, message, bot, PREFIX):
|
async def handle_command(room, message, bot, PREFIX):
|
||||||
"""
|
"""
|
||||||
Function to handle YouTube video information from links.
|
Function to handle YouTube video information from links.
|
||||||
@ -28,10 +33,10 @@ async def handle_command(room, message, bot, PREFIX):
|
|||||||
video = YouTube(youtube_url)
|
video = YouTube(youtube_url)
|
||||||
title = video.title
|
title = video.title
|
||||||
description = video.description
|
description = video.description
|
||||||
length = video.length
|
length = seconds_to_minutes_seconds(video.length)
|
||||||
views = video.views
|
views = video.views
|
||||||
author = video.author
|
author = video.author
|
||||||
info_message = f"""**🎬🎝 Title:** {title} | **Length**: {length} sec | **Views:** {views} | **Description:** {description}"""
|
info_message = f"""**🎬🎝 Title:** {title} | **Length**: {length} minutes| **Views:** {views} | **Description:** {description}"""
|
||||||
await bot.api.send_markdown_message(room.room_id, info_message)
|
await bot.api.send_markdown_message(room.room_id, info_message)
|
||||||
logging.info("Sent YouTube video information to the room")
|
logging.info("Sent YouTube video information to the room")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -1,35 +1,4 @@
|
|||||||
aiofiles==23.2.1
|
python-dotenv
|
||||||
aiohttp==3.9.3
|
requests
|
||||||
aiohttp-socks==0.7.1
|
pytube
|
||||||
aiosignal==1.3.1
|
duckduckgo_search
|
||||||
async-timeout==4.0.3
|
|
||||||
attrs==23.2.0
|
|
||||||
certifi==2024.2.2
|
|
||||||
cffi==1.16.0
|
|
||||||
charset-normalizer==3.3.2
|
|
||||||
cryptography==42.0.2
|
|
||||||
frozenlist==1.4.1
|
|
||||||
h11==0.14.0
|
|
||||||
h2==4.1.0
|
|
||||||
hpack==4.0.0
|
|
||||||
hyperframe==6.0.1
|
|
||||||
idna==3.6
|
|
||||||
jsonschema==4.21.1
|
|
||||||
jsonschema-specifications==2023.12.1
|
|
||||||
Markdown==3.5.2
|
|
||||||
matrix-nio==0.23.0
|
|
||||||
multidict==6.0.5
|
|
||||||
pillow==10.2.0
|
|
||||||
pycparser==2.21
|
|
||||||
pycryptodome==3.20.0
|
|
||||||
python-cryptography-fernet-wrapper==1.0.4
|
|
||||||
python-dotenv==1.0.1
|
|
||||||
python-socks==2.4.4
|
|
||||||
pytube==15.0.0
|
|
||||||
referencing==0.33.0
|
|
||||||
requests==2.31.0
|
|
||||||
rpds-py==0.17.1
|
|
||||||
toml==0.10.2
|
|
||||||
unpaddedbase64==2.1.0
|
|
||||||
urllib3==2.2.0
|
|
||||||
yarl==1.9.4
|
|
||||||
|
Loading…
Reference in New Issue
Block a user