From f8000f2f6c58f8b7b503561e14e46fac74f77620 Mon Sep 17 00:00:00 2001 From: reform Date: Mon, 26 Oct 2026 12:38:59 +0300 Subject: [PATCH] =?UTF-8?q?bot:=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BC=D1=91=D1=80=D1=82=D0=B2=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=5Fapi,=20owner-=D0=BB=D0=B8=D0=BC=D0=B8=D1=82?= =?UTF-8?q?=20=D1=87=D0=B8=D1=82=D0=B0=D0=B5=D1=82=20OMNI=5FBOT=5FOWNERS?= =?UTF-8?q?=20=D0=B8=D0=BB=D0=B8=20OMNI=5FBOT=5FALLOW?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/state/gh/device-id | 1 + omni/bot.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .local/state/gh/device-id 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"))