You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This calls the addPoll(message) function, which is located in another file:
├── main.py
└── func
└── add_poll.py <- Just here
In add_poll.py, there's another function write_num(message, options) that's not working as expected when called with bot.register_next_step_handler(msg, write_num).
However, when you move both addPoll and write_num functions to the main.py file, everything works fine. The reason for this might be related to the way modules are imported or the order of execution. Ensure that you're importing the functions correctly and that the necessary dependencies are in place. Check for any circular dependencies as well.
This discussion was converted from issue #2088 on November 30, 2023 14:52.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good Day.
In my Telegram bot code, I have a command assigned like this:
This calls the
addPoll(message)
function, which is located in another file:In
add_poll.py
, there's another functionwrite_num(message, options)
that's not working as expected when called withbot.register_next_step_handler(msg, write_num)
.However, when you move both
addPoll
andwrite_num
functions to themain.py
file, everything works fine. The reason for this might be related to the way modules are imported or the order of execution. Ensure that you're importing the functions correctly and that the necessary dependencies are in place. Check for any circular dependencies as well.Beta Was this translation helpful? Give feedback.
All reactions