'use strict';
const Telegram = require('telegram-node-bot');
const TelegramBaseController = Telegram.TelegramBaseController;
const TextCommand = Telegram.TextCommand;
const tg = new Telegram.Telegram('***', {
webhook: {
url: '***',
port: 51456,
host: 'localhost'
}
});
class StartController extends TelegramBaseController {
startHandler($) {
$.sendMessage('Hi! I am telegram bot from ONYX Agency.' +
' Write appropriate commands in order to get information you need about us.');
};
get routes() {
return {
'startCommand': 'startHandler'
};
}
}
class AboutController extends TelegramBaseController {
aboutHandler($) {
$.sendMessage('We are Onyx Agency. A unique agency, combining all the types of ' +
'digital services, such as web development, graphic design, photo- and ' +
'videography and social media management, aimed at promoting and PR of your company. ' +
'Additionally, we are young and creative people, full of incredible and ' +
'interesting ideas for you and your projects.');
}
get routes() {
return {
'aboutCommand': 'aboutHandler'
};
}
}
class ServicesController extends TelegramBaseController {
servicesHandler($) {
$.runMenu({
message: 'Select:',
layout: [1, 1, 1, 1],
'Web Development': () => {
$.sendMessage('We create all kinds of websites, starting from the simplest, one-page ones, ' +
'to sites with difficult system and many pages. If you want your website to be a unique trademark ' +
'with distinctive features, then scroll the page till the end and write down our contacts.');
$.sendPhoto({ url: '
http://onyxagency.az/images/portfolio/friends/img1.jpg', filename: 'Web-site for Friends Cinema & Game Center'});
},
'Graphic Design': () => {
$.sendMessage('Logotypes, business cards, brochures, catalogues, brand books, posters and other elements ' +
'of your unique corporate style - all of this will be prepared by our graphic designer according to the ' +
'latest trends in the sphere and with consideration of your individual taste.');
$.sendPhoto({ url: '
http://onyxagency.az/images/portfolio/noirlounge/img1.jpg', filename: 'Logotype for Noir Lounge'});
},
'Videography': () => {
$.sendMessage('If you want a crew for a videoshooting, which besides a quality and fast work will also joy ' +
'you with a unique scenario and provide you with lots of positive emotions at the set (just look at our backstage!), ' +
'then ONYX Agency is exactly what you are looking for.');
$.sendPhoto({ url: '
http://onyxagency.az/images/portfolio/beautesalon/img7.jpg', filename: 'Backstage photo from shooting Beaute Salon Promo Video'});
},
'Photography': () => {
$.sendMessage('Our photographers will make a photomodel out of any person thanks to their professionalism ' +
'and creative approach to their work. Moreover, we will help you by capturing the most touching and important ' +
'moments of your life, making them the part of your history.');
$.sendPhoto({ url: '
http://onyxagency.az/images/portfolio/festivalada/img1.jpg', filename: 'International Festival at ADA'});
},
});
}
get routes() {
return {
'servicesCommand': 'servicesHandler'
};
}
}
tg.router
.when(new TextCommand('/start', 'startCommand'), new StartController())
.when(new TextCommand('/about', 'aboutCommand'), new AboutController())
.when(new TextCommand('/services', 'servicesCommand'), new ServicesController());