Code: Select all
import os
import telebot
token = '-token'
chat_id = 123456789
bot = telebot.TeleBot(token)
bot.send_message(chat_id, "Hello", bot.user)
Code: Select all
File "C:\Users\danaa\AppData\Local\Programs\Python\Python312\Lib\site-packages\telebot\apihelper.py", line 195, in _check_result
raise ApiTelegramException(method_name, result, result_json)
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 404. Description: Not Found