1 year ago

#303858

test-img

Guilherme Laudino

BOT Telegram in Python run in IDLE but won't runs in terminal

I made a simple program in python to send a message in a group on telegram. The program works normally in IDLE (Jupyter/Spyder), however the program.py doesn't work when run directly by python.exe

import telegram

TELEGRAM_BOT_TOKEN = '5xxxxxxxxx:AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXM'
TELEGRAM_CHAT_ID = '-7XXXXXXXX'


bot = telegram.Bot(token=TELEGRAM_BOT_TOKEN)

bot.send_message(chat_id=TELEGRAM_CHAT_ID, text=" Test ")

ps: The others programs (other libraries) works normally. When running this program no error appears, but it opens the terminal and nothing appears

python

python-3.x

telegram-bot

python-idle

0 Answers

Your Answer

Accepted video resources