go-telegram-bot-api / telegram-bot-api

Golang bindings for the Telegram Bot API
https://go-telegram-bot-api.dev
MIT License
5.58k stars 863 forks source link

How to use ForceReply #627

Closed kateile closed 1 year ago

kateile commented 1 year ago

Hi devs. I am having problems using ForceReply. Here is what I have tried but doesn't work

    tgId := query.From.ID

    msg := tg.NewMessage(tgId, "")

    msg.Text = fmt.Sprintf("Please type your Phone number")
    msg.ReplyMarkup = tg.ForceReply{
        ForceReply:            true,
        InputFieldPlaceholder: "Type Phone number",
        Selective:             false,
    }

I get the following error

2023/01/25 13:08:20 Endpoint: editMessageText, response: {"ok":false,"error_code":400,"description":"Bad Request: field \"inline_keyboard\" of the InlineKeyboardMarkup must be an Array"}

2023/01/25 13:08:20 Bad Request: field "inline_keyboard" of the InlineKeyboardMarkup must be an Array

I believe I miss something. Any help will be appreciated

victormedranop commented 1 year ago

Los unites 2 puertos con que puedo probar son

@.**:~/GoClient $ telnet s4hdev.hiperole.com.do 3299 Trying 148.103.9.40... Connected to s4hdev.hiperole.com.do. Escape character is '^]'. NI_RTERR(��ERR1connection timed out-5NI (network interface)75340/bas/753_REL/src/base/ni/nirout.cpp8195RTPENDLIST::timeoutPend: no route received within 5s (CONNECTED)Wed Feb 8 17:13:29 202336SAProuter 40.4 on 'hodevwd00'ERR*Connection closed by foreign host.

@.***:~/GoClient $ telnet s4hdev.hiperole.com.do 8502 Trying 148.103.9.40... Connected to s4hdev.hiperole.com.do. Escape character is '^]'.

Y responden.

Victor

On Feb 8, 2023, at 4:16 PM, Sylvanus Kateile @.***> wrote:

Closed #627 https://github.com/go-telegram-bot-api/telegram-bot-api/issues/627 as completed.

— Reply to this email directly, view it on GitHub https://github.com/go-telegram-bot-api/telegram-bot-api/issues/627#event-8472661377, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIGR6CI6GVEC2BP3TFM6ADWWP5K3ANCNFSM6AAAAAAUGEBK2I. You are receiving this because you are subscribed to this thread.