45 Commits

Author SHA1 Message Date
bvn13
691fa16c19 fix 2026-06-29 14:13:11 +03:00
bvn13
e725f33ed3 Fix !sub names: read config after get_dialogs, not before
list_subscriptions() was called before the get_dialogs() await.
During that await the event loop could process a !reload and replace
self.__config; subsequent set_name calls would then update the orphaned
old config object while !sub list reads from the new one.

Move list_subscriptions() after get_dialogs() so both the entity cache
and the config snapshot are taken from the same post-reload state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 20:27:11 +03:00
bvn13
73e8e4b507 Fix !sub names: warm entity cache before resolving, show per-rule result
get_entity fails silently for chats not yet cached in current session.
Call get_dialogs() first to populate the cache, then resolve all titles.
Show each updated name so it's clear what was resolved (and what wasn't).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 20:08:59 +03:00
bvn13
501614f9c9 Change name template and add !sub names to actualize all names
New format: [contain/regexp] 'rule' = [id_from] name_from -> [id_dest] name_dest
!sub names resolves chat titles for all existing rules and updates their names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:57:43 +03:00
bvn13
bb203a7356 Fix add line number: report list position, not internal id
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:47:29 +03:00
bvn13
4fdde9a9dc Change !sub list/del/on/off to use line numbers
!sub list now shows numbered lines; del/on/off operate by line number
instead of internal rule id — simpler to use from chat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:25:02 +03:00
bvn13
51bd0b4b03 Add deduplication and auto-name for subscriptions
- Config: add_subscription returns None on duplicate (same src, filter, dst)
- Bot: resolve chat titles via get_entity, name rule as
  "src -> dst (filter_value)"; show duplicate message instead of adding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:23:16 +03:00
bvn13
df2cab6b2b Fix forward: resolve entity before forwarding, catch PeerIdInvalidError
get_entity ensures Telethon has the peer cached before forwarding.
Wrap in try/except so a bad destination logs an error instead of
crashing the entire message handler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:06:56 +03:00
bvn13
6c2c07430a Fix save on Docker bind-mount: write in-place instead of atomic rename
os.replace (rename) changes the inode which Docker bind-mounts prohibit
(EBUSY). Write directly to the file instead; a single-process writer
with RLock is safe without atomic rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 11:09:44 +03:00
bvn13
c53e58baf1 Add dynamic subscription management via Telegram commands
- Config: atomic JSON writes, stable rule ids + enabled flag with backfill,
  list/add/remove/set_enabled methods
- Bot: admin whitelist (TG_ADMIN_IDS), gate admin commands, new !sub
  list/add/del/on/off commands, skip disabled rules on forward
- main/compose: read TG_ADMIN_IDS from environment

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:30:18 +03:00
eb3a9873d7 Update version 2024-12-28 00:56:00 +03:00
369086df76 Update src/main.py 2024-12-28 00:55:46 +03:00
bvn13
14f91fc512 fixes 2024-11-12 02:15:51 +03:00
bvn13
6a9948ae6c fixes 2024-11-12 02:10:05 +03:00
bvn13
12fc75622e fixes 2024-11-12 02:05:13 +03:00
cb13fbf21a Update version 2024-11-12 01:55:51 +03:00
bvn13
02e91387f7 upd 2024-08-09 09:12:45 +03:00
bvn13
37ffba0716 upd image 2024-08-09 09:03:57 +03:00
bvn13
9e6d92f113 version up 2024-08-08 23:15:04 +03:00
bvn13
6fdaa6bf77 added new source 2024-08-08 23:12:38 +03:00
bvn13
41fc9469e2 added new source for news 2024-07-24 19:37:40 +03:00
bvn13
7a8b201478 fix 2024-07-20 09:06:00 +03:00
bvn13
abedd82cf5 fix 2024-07-20 09:01:26 +03:00
bvn13
4f6762d49a fix 2024-07-20 08:57:22 +03:00
bvn13
6bcb13479e upd 2024-07-19 09:18:22 +03:00
bvn13
94113e3025 upd 2024-07-19 09:10:54 +03:00
bvn13
9a4be640d1 update timezone 2024-07-19 08:53:26 +03:00
bvn13
5ed0f9c4e7 upd time 2024-07-19 00:53:16 +03:00
bvn13
c3b2f2938a fix update 2024-07-19 00:50:47 +03:00
bvn13
bcc43c3ff5 implemented weather job 2024-07-19 00:45:23 +03:00
bvn13
08fa257545 version up 2024-07-17 21:23:30 +03:00
bvn13
94afeaa4e1 new source 2024-07-17 21:22:06 +03:00
bvn13
d2a5c97035 fixed bug with breaking of config reading 2024-07-11 22:38:30 +03:00
bvn13
b3aeae64e9 upd 2024-07-11 00:58:11 +03:00
bvn13
3adc44fe8e upd 2024-07-11 00:52:20 +03:00
bvn13
36b3695bda upd 2024-07-11 00:42:49 +03:00
bvn13
4bea377611 upd 2024-07-11 00:37:47 +03:00
bvn13
281e54c2cd upd 2024-07-11 00:17:35 +03:00
bvn13
0ef3baec4c upd 2024-07-11 00:13:46 +03:00
bvn13
e0ddbeb4b7 upd 2024-07-11 00:11:45 +03:00
bvn13
cefa440eb7 upd 2024-07-11 00:11:01 +03:00
bvn13
6ce54f3cc5 upd 2024-07-11 00:06:10 +03:00
bvn13
ba2c8b7b8b update 2024-07-11 00:05:22 +03:00
bvn13
1f9d38148c prod tuning 2024-07-10 23:52:19 +03:00
bvn13
2ee1722836 squashed 2024-07-10 23:16:19 +03:00