Skip to content
Snippets Groups Projects
Commit 32ba2645 authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

add start and connect messages

parent 82e39307
No related branches found
No related tags found
No related merge requests found
require('./telegram');
\ No newline at end of file
const TelegramBot = require('node-telegram-bot-api');
const config = require('./config');
const bot = new TelegramBot(config.telegram.token, { polling: true });
bot.onText(/\/start/, (msg, _) => {
const chatId = msg.chat.id;
const resp = 'Holà, je suis le happy botday, je suis là pour vous souhaiter vous rapeller les anniversaires de vos potes !\nPour commencer, il faut que quelqu\'un s\'identifie : /connect';
bot.sendMessage(chatId, resp);
});
bot.onText(/\/connect/, (msg, _) => {
const chatId = msg.chat.id;
const resp = `Pour vous identifier, connectez-vous via l\'OAuth2 de ViaRézo depuis ce lien : ${config.website.protocol}://${config.website.url}/${chatId}`;
bot.sendMessage(chatId, resp);
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment