1
0
Fork 0

Use .env file

This commit is contained in:
Alex Kotov 2023-01-08 17:01:33 +04:00
parent 2972cca582
commit 3e63c3b6e0
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 10 additions and 4 deletions

4
.env.example Normal file
View file

@ -0,0 +1,4 @@
MATRIX_HOMESERVER_URL='https://matrix.org'
MATRIX_FULL_USER_ID='@fckidiots:matrix.org'
MATRIX_PASSWORD='...'
TELEGRAM_BOT_TOKEN='5890667880:...'

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.env

View file

@ -1,15 +1,16 @@
#!/usr/bin/env python3
import asyncio
import os
import sys
import aiogram as telegram
import nio as matrix
MATRIX_HOMESERVER_URL = 'https://matrix.org'
MATRIX_FULL_USER_ID = '@fckidiots:matrix.org'
MATRIX_PASSWORD = '...'
TELEGRAM_BOT_TOKEN = '5890667880:...'
MATRIX_HOMESERVER_URL = os.environ['MATRIX_HOMESERVER_URL']
MATRIX_FULL_USER_ID = os.environ['MATRIX_FULL_USER_ID']
MATRIX_PASSWORD = os.environ['MATRIX_PASSWORD']
TELEGRAM_BOT_TOKEN = os.environ['TELEGRAM_BOT_TOKEN']
async def main():
try: