certifi 2021.10.8
charset-normalizer 2.0.6
idna 3.2
pip 21.2.4
pyTelegramBotAPI 4.1.1
requests 2.26.0
setuptools 57.4.0
urllib3 1.26.7
import telebot
token = "token"
bot = telebot.TeleBot(token)
bot.send_message(chat id,'mq')
print('mqmqmqmq')
Traceback (most recent call last):
File "C:\Users\Yura\Desktop\steal\steal.py", line 6, in
bot.send_message(789511645,'mq')
File "D:\Python\lib\site-packages\telebot\__init__.py", line 942, in send_message
apihelper.send_message(
File "D:\Python\lib\site-packages\telebot\apihelper.py", line 257, in send_message
return _make_request(token, method_url, params=payload, method='post')
File "D:\Python\lib\site-packages\telebot\apihelper.py", line 145, in _make_request
json_result = _check_result(method_name, result)
File "D:\Python\lib\site-packages\telebot\apihelper.py", line 172, in _check_result
raise ApiTelegramException(method_name, result, result_json)
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 401. Description: Unauthorized