From 6fd1c76d1016c61131166e7db6399253516e4b73 Mon Sep 17 00:00:00 2001 From: Joshua Gottlieb Date: Fri, 11 Oct 2024 21:58:27 -0500 Subject: [PATCH] readme update, docker-compse.yml update -- both with better instructions --- README.MD | 32 ++++++++++++++++++++++---------- docker-compose.yml | 23 ++++++++++++++++++++++- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/README.MD b/README.MD index c02ddb7..dd42edc 100644 --- a/README.MD +++ b/README.MD @@ -59,29 +59,41 @@ ### How to set up the bot: 1. Go to https://discord.com/developers and set up an app and get a token. Put that token in a file called token (no file extension needed), and put that file in a subfolder called secrets. -2. At https://discord.com/developers/ - generate an invite code under oauth2 to invite your bot to your server. Under scope make sure bot is checked, and maybe commands? - Give the bot permissions you want it to have. At minimum it'll need to be able to post messages +2. At https://discord.com/developers/ - generate an invite code under oauth2 to invite your bot to your server. Under scope make sure bot is checked. + Give the bot permissions you want it to have. At minimum it'll need to be able to post messages and embeds 3. Go to the bot section in the developers portal and turn on all the intents. 4. In the Constants.py file, change the GUILD_ID value to the guild id of your server, and each platform NOTIFICATION_CHANNEL_ID to the channel ID you want alerts posted to. To easily get both of these IDs, in discord advanced options turn on developer mode. After that you can right click servers/channels and a new option to copy the IDs will be available. Also edit and add vairus URLs to your streamer in Constants.py. Everything is described in comments. -5. Make sure you have python 3.10 or better installed. - - make sure you have Chrome/Chromium and Xvfb installed. Xephyr,Xvnc or another browser may work but not tested. - - run command 'pip install -r requirements.txt' -6. Generate the database with 'python GenerateDatabase.py' or 'python3 GenerateDatabase.py' +5. Generate the database with 'python GenerateDatabase.py' or 'python3 GenerateDatabase.py' +6. Make sure you have python 3.10 installed. + - make sure you have Chrome/Chromium another browser may work but not tested. + - Make sure Xvfb is installed if on Linux. Xephyr, or Xvnc may work but untested + - run command 'pip install -r requirements.txt' 7. Replace images in the image folder with those of your streamer, but keep same file names. - images/errIcon.png - icon used for embeds if there is an issue getting one from the platform, or if one doesn't exist - images/twitErrImg.jpg - default photo used for embeds if no other thumbnail or photo can be grabbed from the image list (if its empty) - images/avatars/calmStreamer.png - Bot avatar if streamer has streamed within the MIN_TIME_BEFORE_AVATAR_CHANGE time frame (default 48 hours) - images/avatars/pissedStreamer.png - Bot avatar if streamer hasn't streamed within the MIN_TIME_BEFORE_AVATAR_CHANGE time frame -8. Start the server: 'python3 run.py' or 'python run.py' +8. Start the bot: 'python3 run.py' or 'python run.py' + +### How To: Docker Compose or Portainer + +1. Install Docker +2. Install Docker Compose and/or Portainer +3. Complete steps 1-5 above in the "how to set up the bot" section +4. Edit docker-compose.yml and follow the commented instructions +5. If using docker compose, from the Sassbot directory start it via "sudo docker compose up -d" +6. If using Portainer go to stacks > add stack + - Copy paste over the non commented code from docker-compose.yml into the window + - Deploy Stack ### Known Issues 1. If multiple accounts are streaming on the same platform at the same time, /rebroadcast will only show an announcement for one of the accounts. -2. Cam4 will api ban your IP if you make too many calls from the same ip. May need to switch methods in the future. -3. Fansly will 404 you for a period of time if you make too many requests from the same ip -4. If you are in a state that requires age verification, some of these checkers wont work. +2. Cam4 will ban your IP if you make too many calls from the same ip to the api. Make check times very long and/or rotate your ip +3. Fansly will 404 you for a period of time if you make too many requests from the same ip. +4. If the requesting ip is in a state that requires age verification, some of these checkers wont work. ### Update History - 10/11/2024 diff --git a/docker-compose.yml b/docker-compose.yml index b034aba..3c3e963 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,10 @@ +# This exmple works on my machine but obviously /home/bombg/Repos won't be on yours. +# So change /home/bombg/Repos/SassBot to wherever sassbot is located on your machine +# I.E if your local machine Sassbot is in /Example/Repos/SassBot then +# /home/bombg/Repos/SassBot/Constants.py:/opt/SassBot/Constants.py +# Becomes +# /Example/Repos/SassBot/Constants.py:/opt/SassBot/Constants.py -- Right side of the colon stays the same +# Make sure you've edited Constants, created the /secrets/token file AND generated the database before you start the image (Follow intructions Steps 1-5) services: sassbot: image: ghcr.io/bombg/sassbot:latest #ghcr.io/bombg/sassbot:latest-arm for arm processors i.e. Raspberry Pi @@ -5,4 +12,18 @@ services: - /home/bombg/Repos/SassBot/Constants.py:/opt/SassBot/Constants.py - /home/bombg/Repos/SassBot/secrets:/opt/SassBot/secrets - /home/bombg/Repos/SassBot/sassBot.db:/opt/SassBot/sassBot.db - restart: unless-stopped \ No newline at end of file + restart: unless-stopped + +# The example below is if you want to look at images nodriver has created for troubleshooting purposes +# Make sure you touch create the jpg files before you start the image or they'll be created as folders (and be useless) +# services: +# sassbot: +# image: ghcr.io/bombg/sassbot:latest +# volumes: +# - /home/bombg/Repos/SassBot/Constants.py:/opt/SassBot/Constants.py +# - /home/bombg/Repos/SassBot/secrets:/opt/SassBot/secrets +# - /home/bombg/Repos/SassBot/sassBot.db:/opt/SassBot/sassBot.db +# - /home/bombg/Repos/SassBot/Fansscreenshot.jpg:/opt/SassBot/Fansscreenshot.jpg +# - /home/bombg/Repos/SassBot/Ofscreenshot.jpg:/opt/SassBot/Ofscreenshot.jpg +# - /home/bombg/Repos/SassBot/KickScreenshot.jpg:/opt/SassBot/KickScreenshot.jpg +# restart: unless-stopped \ No newline at end of file