From b4fe6270a9645eafc900714ac0d7c14587852a3f Mon Sep 17 00:00:00 2001 From: Polish Hammer Date: Thu, 17 Apr 2025 20:44:39 +0200 Subject: [PATCH] Fixes after reinstall --- constants.py | 2 +- install_main_bot.sh | 20 +++++++++++--------- requirements_bot.txt | 2 +- thin_client.py | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) mode change 100644 => 100755 thin_client.py diff --git a/constants.py b/constants.py index 322c2c3..d24a850 100644 --- a/constants.py +++ b/constants.py @@ -81,7 +81,7 @@ if platform in ("linux", "linux2"): MUSIC_FOLDER = "/home/pi/RetroPie/mp3/" SETTINGS_FILE = "/home/pi/Conjurer/settings.json" NETRC_FILE = "/home/pi/.netrc" - LOGSTORE = "/home/pi/RetroPie/logs/" + LOGSTORE = "/home/pi/Conjurer/logs/" ACCIDENT_LOG = "/home/pi/Conjurer/accident_log.json" ENCODING = "utf-8" GRAPHICS_PATH = "/home/pi/RetroPie/Conjurer_graphics/" diff --git a/install_main_bot.sh b/install_main_bot.sh index ac58dcb..33c4b22 100755 --- a/install_main_bot.sh +++ b/install_main_bot.sh @@ -1,20 +1,22 @@ #!/bin/bash sudo apt-get install python3-dev +sudo apt-get install portaudio19-dev python3-pyaudio +sudo apt-get install cd /home/pi || exit mdkir Conjurer cd Conjurer ||exit -python3 -m venv /home/pi/Conjurer/.venv +python3 -m venv /home/pi/Conjurer/.env cp /home/pi/conjurer/requirements_bot.txt /home/pi/Conjurer/ # trunk-ignore(shellcheck/SC1091) -source /home/pi/Conjurer/.venv/bin/activate -./env/bin/python3 -m pip install --upgrade pip -./env/bin/python3 -m pip install -r requirements_bot.txt -sed -i -e 's/os.rename/shutil.copy/g' ./env/lib/python3.11/site-packages/spotify_dl/youtube.py -sed -i '1i\import shutil' ./env/lib/python3.11/site-packages/spotify_dl/youtube.py -sed -i '1i\import logging' ./env/lib/python3.11/site-packages/spotify_dl/spotify.py +source /home/pi/Conjurer/.env/bin/activate +./.env/bin/python3 -m pip install --upgrade pip +./.env/bin/python3 -m pip install -r requirements_bot.txt +sed -i -e 's/os.rename/shutil.copy/g' ./.env/lib/python3.11/site-packages/spotify_dl/youtube.py +sed -i '1i\import shutil' ./.env/lib/python3.11/site-packages/spotify_dl/youtube.py +sed -i '1i\import logging' ./.env/lib/python3.11/site-packages/spotify_dl/spotify.py -sed -i '21i\ logger = logging.getLogger("discord")' ./env/lib/python3.11/site-packages/spotify_dl/spotify.py -sed -i '22i\ logger.info("Playlist")' ./env/lib/python3.11/site-packages/spotify_dl/spotify.py +sed -i '21i\ logger = logging.getLogger("discord")' ./.env/lib/python3.11/site-packages/spotify_dl/spotify.py +sed -i '22i\ logger.info("Playlist")' ./.env/lib/python3.11/site-packages/spotify_dl/spotify.py #add sed changing signal registration to catch exception in spotify dl init deactivate sudo cp ./conjurer.service /etc/systemd/system/ diff --git a/requirements_bot.txt b/requirements_bot.txt index 2831a78..9eeca53 100644 --- a/requirements_bot.txt +++ b/requirements_bot.txt @@ -17,4 +17,4 @@ waitress clickupython assemblyai[extras] SpeechRecognition -git+https://github.com/imayhaveborkedit/discord-ext-voice-recvO \ No newline at end of file +git+https://github.com/imayhaveborkedit/discord-ext-voice-recv diff --git a/thin_client.py b/thin_client.py old mode 100644 new mode 100755 index cbb1c33..efac6cb --- a/thin_client.py +++ b/thin_client.py @@ -75,8 +75,8 @@ async def on_ready(): for com in client.commands: logger.info("Command %s is awejleble", com.qualified_name) - logger.info("Logged in as ---->", client.user) - logger.info("ID:", client.user.id) + logger.info("Logged in as ----> %s", client.user) + logger.info("ID:%s ", client.user.id) logger.info("All systems: operational")