benjick / meteor-telegram-bot

Telegram bot plugin for Meteor
24 stars 15 forks source link

Conversation doesn't work if the user doesn't have a username set #22

Open elie222 opened 8 years ago

elie222 commented 8 years ago

Conversation doesn't work if the user doesn't have a username set.

Username is then undefined which breaks the example in the documentation, and even if you give some username, then parsePollResult will still break.

fckngold commented 8 years ago

Any progress?

shrmnk commented 8 years ago

Hey, I'll get started on this tomorrow. Sorry, was busy with some tests the past few weeks

frranck commented 8 years ago

@shrmnk Hi, I had no username and the example in the documentation didn't work, except the "TelegramBot.setCatchAllText(true, function(username, message)" I added an username in Telegram but the command examples still don't work for me... Any clue?

shrmnk commented 8 years ago

If you're free, could you check if this issue still persists on v1.3.0? I have no resources to set up a test environment at the moment so I can't work on them yet

frranck commented 8 years ago

@shrmnk thanks it's now working for me in v1.3.0 Didn't test without a username though...

elie222 commented 8 years ago

Yeah. It was clear from the code that it wouldn't work without a username. It's got nothing to do with the meteor version.

It just wasn't tested for the no username case which caused a bug. Probably not a difficult fix On 22 May 2016 18:45, "frranck" notifications@github.com wrote:

@shrmnk https://github.com/shrmnk thanks it's now working for me in v1.3.0 Didn't test without a username though...

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/benjick/meteor-telegram-bot/issues/22#issuecomment-220839226

frranck commented 8 years ago

@elie222 the meteor-telegram-bot version is 1.3.0...

elie222 commented 8 years ago

:) sorry about that. Then ignore what I said On 23 May 2016 08:32, "frranck" notifications@github.com wrote:

@elie222 https://github.com/elie222 the meteor-telegram-bot version is 1.3.0...

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/benjick/meteor-telegram-bot/issues/22#issuecomment-220890678

fckngold commented 8 years ago

In TelegramBot.parsePollResult change const fromUsername = item.message.from.username; to const fromUsername = item.message.from.id; and in TelegramBot.startConversation remove typeof(username) === 'string' && Сan anybody confirm this?

McBrick commented 7 years ago

hi, thanks for this package.. i’d like to use this package, but i dunno the right way to use local package for overcome this username problem, can anyone tell me? or can anyone amend the code similar to MeDBejoHok’s suggestion?

thank you

elie222 commented 7 years ago

Go to your meteor project. Create a packages folder. Go to that folder in the command line and do git clone the url for this package.

I think that's about it (you also need to add this package to your meteor project). You can check it all worked if you do meteor list in the root of your project and see a + symbol next to the package version. That means it's a local package.

But I think pull requests were made to fix this no?

On 21 Dec 2016 2:23 p.m., "McBrick" notifications@github.com wrote:

hi, thanks for this package.. i’d like to use this package, but i dunno the right way to use local package for overcome this username problem, can anyone tell me? or can anyone amend the code similar to MeDBejoHok’s suggestion?

thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benjick/meteor-telegram-bot/issues/22#issuecomment-268684130, or mute the thread https://github.com/notifications/unsubscribe-auth/AC8oX9BoUrds2Hb_11Ze9wA2rbY8K4qLks5rKcMZgaJpZM4INLTN .

McBrick commented 7 years ago

@elie222 thx for your reply i should have state it clearly.. i know how to add local package, work properly on local machine, but when i push the project to server, it doesn't work, push fail..

McBrick commented 7 years ago

hi, more specifically, i use heroku and i got this error: error: unknown package in top-level dependencies: [package_name] does anyone know how to push to server properly? thanks.