Answer the question
In order to leave comments, you need to log in
How to make a Telegram bot in Golang that sends similar messages to the same chat?
What is the point, I want to write a telegram bot that forwards previously sent messages to a chat with the same title. that is, when the user writes for example "/search text" the bot must find a message with the word "text" and forward it. I can't figure out how to implement this in go.
Answer the question
In order to leave comments, you need to log in
I can't figure out how to implement this in go.
//разделяем предложение на слова по пробелам
arr := strings.Split(m.Text, " ")
//вырезаем первое слово (в нашем случае команду /search)
if arr[0] == "/search"{
msg := strings.TrimPrefix(m.Text, arr[0]+" ")}else{
msg := "Это не поиск!"}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question