question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to handle deep linking? (command parameters, like /start test)

See original GitHub issue

I couldn’t find anything about how can I handle command parameters. bot.command does not support regexes, which means I cannot make it handle deep linking params I have a code such as this:

bot.command('start', ctx => startstuff()) 

bot.hears(/^\/start (.*)$/, ctx => registerReferral()) 

registerReferral() doesnt get fired when using https://telegram.me/mybot?start=test link to access and start it. Instead startstuff() responds.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
Piterdencommented, Sep 10, 2018
bot.hears(/^\/start[ =](.+)$/, (ctx) => registerReferral(ctx.match[1]))
1reaction
Piterdencommented, Oct 7, 2018
(ctx) => {
  let args = message.text.split(' ')
}

What if I have

/command      arg1=val1       arg2=val2

, @Christian-X?

image

But if you do split(/ +/)

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Power Apps Deep Linking Parameters - YouTube
In this video, you'll learn how to use the concept of deep linking to pass a parameter in through a URL or notification...
Read more >
How to Test Deep Links in Android: Three Different Options
The application handles deep links in MainActivity's onCreate method. This method passes the Intent to handleIntent, which verifies that it isn't carrying the ......
Read more >
How to Test Deep Links on Android & iOS devices
Learn how to test Deep Links on Real Android and iOS devices, rather than emulators. Read tutorial to run this free deeplink tester...
Read more >
Create Deep Links to App Content - Android Developers
To allow users to enter your app from links, you must add intent filters for the relevant activities in your app manifest. These...
Read more >
Android Deep Linking with multiple query parameters
Just add \ before & sign when testing with adb. Copy this: adb shell am start -W -a android.intent.action.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found