Skip to content

Commit 5433a42

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

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

plugins/_001_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
def tg_command(bot, update: Update):
1313
tg_group_id = update.message.chat_id # telegram group id
14+
print(tg_group_id)
1415
if tg_group_id > 0: # ignore private chat
1516
raise DispatcherHandlerStop()
1617
for command in global_vars.command_list: # process all non-forward commands

plugins/_005_drive_mode.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,17 @@ def tg_drive_mode(bot, update):
4141
if update.message.forward_from_chat:
4242
if update.message.forward_from_chat.type == 'channel':
4343
if update.message.forward_from_chat.id in filter_list['channels']:
44-
print(1)
4544
drive_mode_on(forward_index, tg_group_id, update.message.from_user, qq_group_id, 0)
4645
raise DispatcherHandlerStop()
4746

4847
for keyword in filter_list['keywords']:
4948
if update.message.caption:
5049
if keyword in update.message.caption:
51-
print(2)
5250
drive_mode_on(forward_index, tg_group_id, update.message.from_user, qq_group_id, 0)
5351
raise DispatcherHandlerStop()
5452
elif update.message.text:
5553
if keyword in update.message.text:
56-
print(3)
54+
print(update.message.chat_id)
5755
drive_mode_on(forward_index, tg_group_id, update.message.from_user, qq_group_id, 0)
5856
raise DispatcherHandlerStop()
5957

0 commit comments

Comments
 (0)