Closed dcsan closed 8 years ago
also the slash commands don't seem to return a chatID, so i cant identify a chat to send a message to, unless its replying to an incoming message.
ok i see you're calling method("getUpdates"
internally
https://github.com/benjick/meteor-telegram-bot/blob/master/telegram-bot.js#L19
and you have something setup for a catchAll
if(msg = item.message.text) {
msg = TelegramBot.parseCommandString(msg)
var obj = _.find(TelegramBot.triggers, function(obj) { return obj.command == msg[0] })
if(obj) {
TelegramBot.send(obj.callback(msg, from, item.message), chatId)
}
}
else {
if(typeof(TelegramBot.catchAll) === 'function') {
TelegramBot.catchAll(item);
}
}
but it looks like the catchAll won't run for just the case where there's no command found - it will only run if if(msg = item.message.text) {
evals to false.
so there's no way to just listen for a command with a message.text?
Hey
I guess catchAll should be named as catchOthers, because it's catching everything that's not a text message. It's kinda shitty implemented right now so I wouldn't use it
Removed the use of catchAll in the latest version
thanks for wrapping this up...
your example shows how to poll for slash commands, but how do i receive all text, esp via long polling?
ref https://core.telegram.org/bots/api#getupdates