I
I
iilushka2018-02-05 13:52:41
Python
iilushka, 2018-02-05 13:52:41

Sending a message to Telegram (Telebot)?

I work in Python with the telebot library.
And so, there are buttons in the bot, I need that when the user clicks on the button, the bot writes to him like: leave a review or a suggestion, and so that this message that the user wrote is resent to me personally, which I can’t do ..
import telebot
from telebot import types
token = 'token'
bot = telebot.TeleBot(token)
@bot.message_handler(commands=['start'])
def start(m):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
markup.row(' 1', '2')
markup.row('Review', '4')
msg=bot.send_message(m.chat.id,'Select item:',reply_markup=markup)
@bot.message_handler(func=lambda message :
if m.text == 'review':
bot.send_message(m.chat.id, 'If you offer cooperation or want to help one-sidedly, then write here. Thank you.')
............
if __name__ == '__main__':
bot.polling(none_stop=True)
What to add to do as I described???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
enabl3, 2018-02-05
@enabl3

What exactly doesn't work?
In order for the message to come to you in a personal, you need to replace m.chat.idthe ID with your personal telegram chat.

I
iilushka, 2018-02-06
@iilushka

enabl3 , before all this, there was nothing, I just didn’t know how to make the message be forwarded to me ..)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question