Skip to content

How to use CopyMessages? #204

Closed Answered by cnekmp
cnekmp asked this question in Q&A
Aug 19, 2024 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Ok, Found a solution. I should provide Type: "video" or Type: "photo" in struct. Providing working code. Closing discussion

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/mymmrac/telego"
)

const (
	botToken = "<TOKEN>"
)

func main() {

	bot, err := telego.NewBot(botToken, telego.WithDefaultDebugLogger())
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	media := []telego.InputMedia{}
	updates, _ := bot.UpdatesViaLongPolling(nil)

	defer bot.StopLongPolling()

	for update := range updates {
		if update.Message != nil {
			if update.Message.MediaGroupID != "" {
				switch {
				case update.Message.Video != nil:
					media = append(media, &telego.InputMediaVideo{Type: "video"…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@mymmrac
Comment options

@cnekmp
Comment options

@mymmrac
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cnekmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants