Skip to content

Commit

Permalink
readme update, docker-compse.yml update -- both with better instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombg committed Oct 12, 2024
1 parent 98bd90c commit 6fd1c76
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
32 changes: 22 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 22 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# 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
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
restart: unless-stopped
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

0 comments on commit 6fd1c76

Please sign in to comment.