Skip to content

Commit

Permalink
Update to 0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BhasherBEL committed May 29, 2023
1 parent 0b746c4 commit fcc4e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ def load_creds():

if not os.path.exists('/data/token'):
client = TgtgClient(email=os.environ.get('TGTG_EMAIL'))
print('Waiting for credentials ...')
credentials = client.get_credentials()
with open('/data/token', 'w') as file:
file.write(str(credentials))
print('Credentials stored in file')
else:
with open('/data/token', 'r') as file:
credentials = json.loads(file.read().replace('\'', '"'))
print('Credentials loaded from file')

client = TgtgClient(**credentials)
bot = telegram.Bot(os.environ['TELEGRAM_TOKEN'])
Expand Down Expand Up @@ -85,6 +88,6 @@ async def main():
time.sleep(60)

if __name__ == '__main__':
check_env()
print('Check environ:', check_env())
load_creds()
asyncio.run(main())
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Tested versions. Upgrade at your own risks
tgtg==0.15.0
python-telegram-bot==20.2
tgtg==0.16.0
python-telegram-bot==20.2

0 comments on commit fcc4e71

Please sign in to comment.