We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
func TestStar(t *testing.T) { price := make([]tgbotapi.LabeledPrice, 0) price = []tgbotapi.LabeledPrice{ tgbotapi.LabeledPrice{ Label: "XTR", Amount: 1, }, } invoice := tgbotapi.NewInvoice(ChatID, "star pay", "start", "v-1", "", "uZzZW3MS1XcCnEyrbBvsFRE8m96dqzQL", "XTR", price) api, err := tgbotapi.NewBotAPI(token) if err != nil { t.Fatal(err) } api.Debug = true invoice.MaxTipAmount = 500 invoice.SuggestedTipAmounts = []int{100, 200, 300} send, err := api.Send(invoice) if err != nil { t.Fatal(err) } fmt.Println(send) }
err: Endpoint: sendInvoice, response: {"ok":false,"error_code":400,"description":"Bad Request: STARS_INVOICE_INVALID"} star_test.go:36: Bad Request: STARS_INVOICE_INVALID
The text was updated successfully, but these errors were encountered:
func TestStar(cmd BuyCommand) { price := []tg.LabeledPrice{ { Label: "XTR", Amount: 1, }, } invoice := tg.NewInvoice( cmd.Update.Message.Chat.ID, "Star Pay", "Purchase Stars", "test", "", "start_param_unique_v1", "XTR", price, ) invoice.SuggestedTipAmounts = []int{} bot := utils.GetBot() sentInvoice, err := bot.Send(invoice) if err != nil { log.Printf("Error sending invoice: %v", err) return } fmt.Println("Invoice sent successfully:", sentInvoice) }
Sorry, something went wrong.
No branches or pull requests
err: Endpoint: sendInvoice, response: {"ok":false,"error_code":400,"description":"Bad Request: STARS_INVOICE_INVALID"}
star_test.go:36: Bad Request: STARS_INVOICE_INVALID
The text was updated successfully, but these errors were encountered: