Skip to content

Callback query handler don't work #2096

Closed

Description

@cap-102

pyTelegramBotAPI 4.14.0 | Windows | Python 3.12.0
So I wanted create some callback query handlers in my bot using this script:
https://pastebin.com/wZfumXXU
But it don't worked. When I tried to to add print statement in the start of my function it also printed nothing.

Then I tried this easy script:
https://pastebin.com/iZAW51jg
But it also don't worked for me

Activity

  1. Roninon commented on Dec 9, 2023

    @Roninon

    Hi, Caportabow! Please, provide your script exception traceback, when its failed. Or, you can add next rows to your code, to get more info about your program:
    import logging logger = logging.getLogger('TeleBot').setLevel(logging.INFO)

  2. cap-102 commented on Dec 9, 2023

    @cap-102
    Author
    #---#
    All contents of data/temp/ have been deleted.
    #---#
    Successfully Started!
    Bot - @IAmBetterBot
    #---#
    
    
    2023-12-10 00:26:12,608 (__init__.py:1040 MainThread) INFO - TeleBot: "Starting your bot with username: [@IAmBetterBot]"
    2023-12-10 00:26:12,609 (__init__.py:1057 MainThread) INFO - TeleBot: "Started polling."
    

    This is full log. My bot don't fail or whenever, it just don't have any effect if I push the buttons

  3. Badiboy commented on Dec 10, 2023

    @Badiboy
    Collaborator

    File "test.py", line 10, in start
    markup = types.InlineKeyboardMarkup()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'types' has no attribute 'InlineKeyboardMarkup'

    import telebot, telebot.types as types

    Now works fine.

    image

  4. Repository owner locked and limited conversation to collaborators on Dec 10, 2023
  5. converted this issue into a discussion #2097 on Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions