Answer the question
In order to leave comments, you need to log in
Why is chat not found?
the code:
def chati(arg):
return arg.split()[1:]
def text(arg):
return arg.split()[2]
@bot.message_handler(commands=["text"])
def sendmt(message):
ci = chati(message.text)
mt = text(message.text)
bot.send_message(chat_id=ci,text=mt)
bot.reply_to(message, 'Отправлено!')
Answer the question
In order to leave comments, you need to log in
print(ci)
- see the list. If you want to get a word, then get just a word, without a cut.
return arg.split()[1]
Either you are passing a non-existent chat_id, or the bot in this chat (which you are passing) is not running. If you want to send a message to someone who knows nothing about the bot, nothing will come of it. The user starts the conversation first.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question