Closed Konfuze closed 8 years ago
@Konfuze
Hi!
There is no such opportunity yet, but i will add routeTo
method soon.
It would be great. Thank's for quick response!
We use of $.routeTo extensively in the old version. Looking forward to seeing this method in version 3. Thanks you for developing this npm module!
tg.controller('MenuController', ($) => {
tg.for('/menu', () => {
$.runMenu({
message: '---Keyboard Menu Available---',
layout: 3,
'Bud': () => {$.routeTo("/bud");},
'Edibles': () => {$.routeTo("/edibles");},
'Wax': () => {$.routeTo("/wax");},
'Specials': () => {$.routeTo("/specials");},
'Restart': () => {$.routeTo("/restart");},
'Feedback': () => {$.routeTo("/feedback");},
'Help': () => {$.routeTo("/help");},
'Upload': () => {$.routeTo("/upload");},
'Payment': () => {$.routeTo("/bitcoin");},
});
});
});
Has the $.routeTo method been added yet? Looking forward to something like that, too.
As @Naltox suggested, there is emulateUpdate method, which can be used like this:
const tg = new Telegram.Telegram(token); tg.emulateUpdate($.update)
@osadchiynikita and how to route? Where I can define the route?
What will be the best practice to access methods of one controller from another without creating a new instance?
For example I want to access methods of
SomethingController
fromStartController
which displays the '/start' menu.In previous version there was a method
$.routeTo('/something')