Skip to content

Commit

Permalink
adding generic images, change path to images in consants, compose exa…
Browse files Browse the repository at this point in the history
…mple change for images
  • Loading branch information
Bombg committed Oct 12, 2024
1 parent 97f34d3 commit 7571d40
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
26 changes: 14 additions & 12 deletions DefaultConstants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Constants:
# COPY THIS FILE AND CREATE YOUR OWN VERSION NAMED AppConstants.py THAT WAY YOU CAN PULL CHANGES WITHOUT OVERWRITING SETTINGS
TEST_SERVER = False
SASSBOT_LOG_LEVEL = 10 # DEBUG = 10, INFO = 20, WARNING = 30, ERROR = 40, CRITICAL = 50
OTHER_LIBRARIES_LOG_LEVEL = 20 # DEBUG = 10, INFO = 20, WARNING = 30, ERROR = 40, CRITICAL = 50
Expand Down Expand Up @@ -45,10 +46,6 @@ class Constants:
CONFESSION_COMMAND_ID = 1159321755270250571
CONFESS_REVIEW_COMMAND_ID = 1159321755270250570

KICK_PROXY = ""
FANS_PROXY = "127.0.0.1:8888"
OF_PROXY = ""

KICK_PROXY = ""
FANS_PROXY = "172.18.0.2:8888"
OF_PROXY = ""
Expand Down Expand Up @@ -209,13 +206,6 @@ class Constants:
scBelowTitleText = f"{streamerName} is now live on StripChat!"
epBelowTitleText = f"{streamerName} is now live on ePlay!"

# Icon in this case is the small image that shows in the top left of the imbed before the streamer's name for that platform
# This is used if an avatar/icon can't be found on a platform, otherwise the platform's version will be used
defaultIcon = 'images/errIcon.png'

# This thumbnail is used if there is no thumbnail for a platform AND there is nothing in the image list
defaultThumbnail = 'images/twitErrImg.jpg'

# Leave empty strings if you want to use default thumbnail behavior; which is: (1)pull thumbnail from platform, (2)if it doesn't exist use image from image list, (3)if list empty use defaultThumbnail
# Add your own image path/url if you want to exclusively use the same image over and over for a specific platform's thumbnail
# If you want thumbnails to only come from the image list, make the string equal to LIST i.e cbThumbnail = "LIST" . Useful if you don't want NSFW thumbnails in alerts
Expand All @@ -229,4 +219,16 @@ class Constants:
mfcThumbnail = ""
bcThumbnail = ""
scThumbnail = ""
epThumbnail = ""
epThumbnail = ""

# Icon in this case is the small image that shows in the top left of the imbed before the streamer's name for that platform
# This is used if an avatar/icon can't be found on a platform, otherwise the platform's version will be used
defaultIcon = 'images/errIcon.png'

# This thumbnail is used if there is no thumbnail for a platform AND there is nothing in the image list
defaultThumbnail = 'images/twitErrImg.jpg'

# Calm is default bot avatar, pissed is what it changes to after MIN_TIME_BEFORE_AVATAR_CHANGE has been met
# Make them the same image if you don't want the feature to change anything
calmAvatar = 'images/avatars/calmStreamer.png'
pissedAvatar = 'images/avatars/pissedStreamer.png'
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ 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/Constants.py:/opt/SassBot/AppConstants.py
- /home/bombg/Repos/SassBot/secrets:/opt/SassBot/secrets
- /home/bombg/Repos/SassBot/sassBot.db:/opt/SassBot/sassBot.db
- /home/bombg/Repos/SassBot/images/errIcon.png:/opt/SassBot/images/errIcon.png
- /home/bombg/Repos/SassBot/images/twitErrImg.jpg:/opt/SassBot/images/twitErrImg.jpg
- /home/bombg/Repos/SassBot/images/avatars/calmStreamer.png:/opt/SassBot/images/avatars/calmStreamer.png
- /home/bombg/Repos/SassBot/images/avatars/pissedStreamer.png:/opt/SassBot/images/avatars/pissedStreamer.png
- /home/bombg/Repos/SassBot/Fae/FaeIcon.png:/opt/SassBot/images/errIcon.png
- /home/bombg/Repos/SassBot/Fae/FaeErr.jpg:/opt/SassBot/images/twitErrImg.jpg
- /home/bombg/Repos/SassBot/Fae/FaeC.png:/opt/SassBot/images/avatars/calmStreamer.png
- /home/bombg/Repos/SassBot/Fae/FaeP.png:/opt/SassBot/images/avatars/pissedStreamer.png
restart: unless-stopped

# The example below is if you want to look at images nodriver has created for troubleshooting purposes
Expand Down
Binary file modified images/avatars/calmStreamer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/avatars/pissedStreamer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/errIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/twitErrImg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions plugins/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ async def changeAvatar(rest: alluka.Injected[hikari.impl.RESTClientImpl]) -> Non
onTime, offTime, totalOnTime = db.getStreamTableValues()
hours, minutes = StaticMethods.timeToHoursMinutes(offTime)
if online and not globals.normalAvtar:
await rest.edit_my_user(avatar = 'images/avatars/calmStreamer.png')
await rest.edit_my_user(avatar = Constants.calmAvatar)
logger.info(f"changed avatar to good {Constants.streamerName}")
globals.normalAvtar = True
if not online and globals.normalAvtar and hours >= Constants.MIN_TIME_BEFORE_AVATAR_CHANGE and offTime != 0:
await rest.edit_my_user(avatar = 'images/avatars/pissedStreamer.png')
await rest.edit_my_user(avatar = Constants.pissedAvatar)
logger.info(f"changed avatar to bad {Constants.streamerName}")
globals.normalAvtar = False

Expand Down

0 comments on commit 7571d40

Please sign in to comment.