diff --git a/.local/state/gh/device-id b/.local/state/gh/device-id new file mode 100644 index 0000000..91ed1c3 --- /dev/null +++ b/.local/state/gh/device-id @@ -0,0 +1 @@ +21311348-6c5d-4922-b48b-df65f227ec1f \ No newline at end of file diff --git a/omni/bot.py b/omni/bot.py index 4cdf2b3..ded5819 100644 --- a/omni/bot.py +++ b/omni/bot.py @@ -30,7 +30,7 @@ from . import feeds, net, source_state, sources, store API = "https://api.telegram.org/bot%s/" % os.environ.get("OMNI_BOT_TOKEN", "") TOKEN = os.environ.get("OMNI_BOT_TOKEN", "") -OWNERS = {int(x) for x in re.findall(r"\d{5,}", os.environ.get("OMNI_BOT_OWNERS", ""))} +OWNERS = {int(x) for x in re.findall(r"\d{5,}", os.environ.get("OMNI_BOT_OWNERS") or os.environ.get("OMNI_BOT_ALLOW") or "")} MAX_LEN = 3600 @@ -39,7 +39,6 @@ def _api(method, **params): raise SystemExit("OMNI_BOT_TOKEN не задан") url = API + method data = urllib.parse.urlencode(params).encode() - r = net.get(url, headers={"Content-Type": "application/x-www-form-urlencoded"}) if False else None req = urllib.request.Request(url, data=data) with urllib.request.urlopen(req, timeout=40) as resp: return json.loads(resp.read().decode("utf-8"))