Skip to content

Commit

Permalink
fix start chat button
Browse files Browse the repository at this point in the history
  • Loading branch information
ComRSMaster committed Nov 17, 2024
1 parent e5c273a commit 6ab799f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions functions/chat_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def register_chat_handler():

bot.register_callback_query_handler(profile_photo_button, None, text=TextFilter(starts_with='btn_photo'))
bot.register_callback_query_handler(pinned_msg_button, None, text=TextFilter(starts_with='btn_pinned'))
bot.register_callback_query_handler(start_chat_button, None, text=TextFilter(starts_with='btn_chat'))

bot.register_edited_message_handler(edit_msg_handler, content_types=content_type_media)
bot.register_inline_handler(inline_query_photo, None)
Expand Down Expand Up @@ -151,6 +152,11 @@ async def pinned_msg_button(call: CallbackQuery):
await bot.answer_callback_query(call.id, "Закреп отправлен!")


async def start_chat_button(call: CallbackQuery):
await start_chat(call.message.chat.id, call.data[call.data.rfind("_") + 1:])
await bot.answer_callback_query(call.id, "Чат начат!")


def todict(obj):
data = {}
for key, value in obj.__dict__.items():
Expand Down
3 changes: 0 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ async def command_cancel(msg: Message):
# def query(call: CallbackQuery):
# elif data.startswith("btn_upload"):
# book_upload_button(data, call)
# elif data.startswith("btn_chat"):
# start_chat(str(call.message.chat.id), data[data.rfind("_") + 1:])
# bot.answer_callback_query(call.id, "Чат начат!")
# elif data.startswith("btn_ignore"):
# db.stats.ignore.append(int(data[data.rfind("_") + 1:]))
# bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id)
Expand Down

0 comments on commit 6ab799f

Please sign in to comment.