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:
12
globals.py
12
globals.py
@ -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')
|
||||
|
Reference in New Issue
Block a user