creds now are pulled from env
This commit is contained in:
parent
4255c82667
commit
4ec8125393
@ -14,6 +14,9 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import requests as r
|
import requests as r
|
||||||
from croniter import croniter # used for checking cron formatting
|
from croniter import croniter # used for checking cron formatting
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv() # loads environment vars
|
||||||
|
|
||||||
# note: for more information about the api visit swagger documentation on https://gruppe1.testsites.info/api/docs#/
|
# note: for more information about the api visit swagger documentation on https://gruppe1.testsites.info/api/docs#/
|
||||||
|
|
||||||
@ -356,7 +359,7 @@ class API_Handler:
|
|||||||
if __name__ == "__main__": # editable, just for basic on the go testing of new functions
|
if __name__ == "__main__": # editable, just for basic on the go testing of new functions
|
||||||
|
|
||||||
print("This is a module for the telegram bot. It is not intended to be run directly.")
|
print("This is a module for the telegram bot. It is not intended to be run directly.")
|
||||||
handler = API_Handler("https://gruppe1.testsites.info/api", "<bot-email>", "<bot-pw>") # do not push with real credentials!!
|
handler = API_Handler("https://gruppe1.testsites.info/api", str(os.getenv("BOT_EMAIL")), str(os.getenv("BOT_PASSWORD"))) # get creds from env
|
||||||
print(handler.token)
|
print(handler.token)
|
||||||
keywords = handler.get_user_keywords(user_id = 1709356058) #user_id here is currently mine (Linus)
|
keywords = handler.get_user_keywords(user_id = 1709356058) #user_id here is currently mine (Linus)
|
||||||
print(keywords)
|
print(keywords)
|
||||||
|
Loading…
Reference in New Issue
Block a user