Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnswerCallbackQuery in URLs #71

Closed
ahmdrz opened this issue Nov 8, 2016 · 2 comments
Closed

AnswerCallbackQuery in URLs #71

ahmdrz opened this issue Nov 8, 2016 · 2 comments

Comments

@ahmdrz
Copy link
Contributor

ahmdrz commented Nov 8, 2016

Is any way to use telegram.me/your_bot?start=XXXX with AnswerCallbackQuery ?
Can you show me a sample code ?

@ahmdrz
Copy link
Contributor Author

ahmdrz commented Nov 8, 2016

My code is :

package main

import (
    "log"
    "time"
    "os" 
    "strings"
    "github.com/tucnak/telebot"
)

func main() {
    bot, err := telebot.NewBot(os.Getenv("BOT_TOKEN"))
    if err != nil {
        log.Fatalln(err)
    }

    messages := make(chan telebot.Message)
    bot.Listen(messages, 1*time.Second)

    for message := range messages {
        if strings.HasPrefix(message.Text, "/start") {
            query := strings.Replace(message.Text, "/start", "", -1)
            query = strings.TrimSpace(query)
            log.Println(query)
        }
    }
}

But I want to know is there any way to look it as a query with AnswerCallbackQuery or not

@tucnak
Copy link
Owner

tucnak commented Nov 26, 2017

telegram.me/your_bot?start=XXXX is just deep-linking and it has nothing to do with AnswerCallbackQuery really.

@tucnak tucnak closed this as completed Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants