Answer the question
In order to leave comments, you need to log in
How to register a user through Telegram bot?
Friends, I write in Google Apps Scrip telegram bot for my friends.
They fix and fix computers. They mainly work with legal entities.
so they need a ticket system for processing applications.
We decided that the telegram bot is perfect for processing applications.
The first thing to do is to register a company.
To do this, I brought up a button:
function doPost(e){
var data = JSON.parse(e.postData.contents);
var text = data.message.text;
var id = data.message.chat.id;
var name = data.message.chat.first_name + " " + data.message.chat.last_name;
var answer = "Салам " + name + "! Спасибо за обращение "+ text;
Logger.log(text + " command passed");
if(text =="/start"){
var options = [
[{ text: 'Новый заказ', callback_data: 'order' }],
[{ text: 'Регистрация', callback_data: 'registration' }],
[{ text: 'Реквизиты', callback_data: 'data' }]
];
sendKeyboard(id, "Приветствую дорогой друг! Чем могу быть полезен?", options, true);
}
else if ( text == "Регистрация" ){
sendMessage(id, "Введите ваше фио");
}
else{
answer = "Text message passed";
sendMessage(id, answer);
}
SpreadsheetApp.openById(ssId).getSheets()[0].appendRow([new Date(), id, name, answer]);
}
Answer the question
In order to leave comments, you need to log in
Maybe it's easier to hire a freelancer?
Full name is three words separated by spaces, starting with a capital letter. You just check the string against this rule and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question