Kumi
f6a3f4ce66
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 8m44s
Renamed `pantalaimon_first_login.py` to `fetch_access_token.py` to better reflect its purpose. Additionally, updated README to remove obsolete instructions for using pantalaimon with the bot.
22 lines
No EOL
509 B
Python
22 lines
No EOL
509 B
Python
from nio import AsyncClient
|
|
|
|
from configparser import ConfigParser
|
|
|
|
async def main():
|
|
config = ConfigParser()
|
|
config.read("config.ini")
|
|
|
|
user_id = input("User ID: ")
|
|
password = input("Password: ")
|
|
|
|
client = AsyncClient(config["Matrix"]["Homeserver"])
|
|
client.user = user_id
|
|
await client.login(password)
|
|
|
|
print("Access token: " + client.access_token)
|
|
|
|
await client.close()
|
|
|
|
if __name__ == "__main__":
|
|
import asyncio
|
|
asyncio.get_event_loop().run_until_complete(main()) |