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
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "Hi, how are you doing?")
for some reason when i run main.py and send /start command to the bot it dosen't response but when i put the main.py and start.py in the same file it works fine
can you explain to me why is this hapening and what is the silultion because i want them seperated
I also think it dosent run at all( maybe) it shows no error or anything on terminal
This discussion was converted from issue #2064 on October 24, 2023 19:46.
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
-
Please answer these questions before submitting your issue. Thanks!
What version of pyTelegramBotAPI are you using? 4.14.0
What OS are you using? Windows
What version of python are you using? 3.11.4
hi there, i have this code in my main.py :
from telebot import TeleBot
bot = TeleBot(token="my_bot_token", parse_mode="MARKDOWN")
if name == 'main':
bot.infinity_polling()
and i have this code in my start.py :
from main import bot
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "Hi, how are you doing?")
for some reason when i run main.py and send /start command to the bot it dosen't response but when i put the main.py and start.py in the same file it works fine
can you explain to me why is this hapening and what is the silultion because i want them seperated
I also think it dosent run at all( maybe) it shows no error or anything on terminal
Beta Was this translation helpful? Give feedback.
All reactions