Skip to content

Commit d83c89e

Browse files
author
jqqqqqqqqqq
committed
telegram bot framework 2.1
add text filter function in drive mode add private chat function
1 parent 5433a42 commit d83c89e

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

plugins/_001_command.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
def tg_command(bot, update: Update):
1313
tg_group_id = update.message.chat_id # telegram group id
14-
print(tg_group_id)
15-
if tg_group_id > 0: # ignore private chat
16-
raise DispatcherHandlerStop()
1714
for command in global_vars.command_list: # process all non-forward commands
1815
if command.tg_only:
1916
if update.message.text == command.command:

plugins/_002_filter_old_message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
def ignore_old_message(bot, update): # ignore old message that are more than 60s ago
99
tg_group_id = update.message.chat_id # telegram group id
10+
if tg_group_id > 0: # ignore private chat
11+
raise DispatcherHandlerStop()
1012
qq_group_id, _, forward_index = get_forward_index(tg_group_id=int(tg_group_id))
1113

1214
if (datetime.datetime.now() - update.message.date).total_seconds() > 60:

plugins/_005_drive_mode.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def tg_drive_mode(bot, update):
5151
raise DispatcherHandlerStop()
5252
elif update.message.text:
5353
if keyword in update.message.text:
54-
print(update.message.chat_id)
5554
drive_mode_on(forward_index, tg_group_id, update.message.from_user, qq_group_id, 0)
5655
raise DispatcherHandlerStop()
5756

0 commit comments

Comments
 (0)