From 60b7c6d50d03e91bb1ded5bef85e3938d5e69c5d Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Sat, 5 Feb 2022 11:25:48 +0100 Subject: [PATCH] Restructure imports --- bin/telelog | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/telelog b/bin/telelog index 1ca0c0b..6c98c1e 100644 --- a/bin/telelog +++ b/bin/telelog @@ -1,9 +1,14 @@ #!/usr/bin/python3 + +# Core libraries +import json +from telethon import TelegramClient, events, functions, types + +# Configuration +# Python apparently has no better way of doing this... import sys sys.path.append("/var/telelog") -from telethon import TelegramClient, events, functions, types from config import * - client = TelegramClient('/var/telelog/log', api_id, api_hash) @client.on(events.NewMessage) @@ -51,7 +56,6 @@ async def log(event): await event.edit(f.read()) if msg.startswith('.tl.set'): - import json key = msg.split()[1] arg = msg.split()[2] with open('/var/telelog/settings.json', 'r+') as settings: