modified white nonsense bot code to be used with any text file with a list of sayings; added notify function to globals and made pushover optional

This commit is contained in:
2025-06-09 14:41:59 -05:00
parent d799e0bae1
commit 990c918c7a
4 changed files with 73 additions and 14 deletions

View File

@ -1,4 +1,13 @@
from os import getenv
from requests import post
def notify(priority, message):
r = post("https://api.pushover.net/1/messages.json", data = {
"token": po_bots_token,
"user": po_user_token,
"message": message,
"priority": priority
})
# Unsplash creds
unsplash_ep = "https://api.unsplash.com/photos/random?query=puppy"
@ -15,6 +24,9 @@ newsfeed_token = getenv('BOTS_NEWSFEED_TOKEN')
whitenonsense_token = getenv('WHITENONSENSE_TOKEN')
randomquotes_token = getenv('BOTS_QUOTESBOT_TOKEN')
botsy_token = getenv('BOTS_BOTSY_TOKEN')
quip_file = getenv('QUIP_FILE')
quip_tags = getenv('QUIP_TAGS')
quip_token = getenv('QUIP_TOKEN')
# Pushover creds
po_endpoint = getenv('PUSHOVER_ENDPOINT')