gotd / td

Telegram client, in Go. (MTProto API)
MIT License
1.5k stars 134 forks source link

CHAT_ID_INVALID: When try to use MessagesAddChatUser #946

Open felipeflores opened 1 year ago

felipeflores commented 1 year ago

What version of gotd are you using?

 github.com/gotd/td v0.73.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

When I'm trying to use

                                       update, err := api.MessagesAddChatUser(ctx, &tg.MessagesAddChatUserRequest{
                        ChatID: peer.ChannelID,
                        UserID: inputUser(user),
                    })
                    if err != nil {
                        return err
                    }

Always I have some problem

rpc error code 400: CHAT_ID_INVALID

What did you expect to see?

User added

What did you see instead?

What Go version and environment are you using?

go1.18.1
go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/felipe/.cache/go-build"
GOENV="/home/felipe/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/felipe/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/felipe/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/felipe/Downloads/teste/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3743326159=/tmp/go-build -gno-record-gcc-switches"
    
DukeAnn commented 10 months ago

Has it been resolved? I also encountered this problem

golanguzb70 commented 2 months ago

I am also having this kind of issue but in some other senario.

chat, err := client.API().UsersGetFullUser(ctx, &tg.InputUser{
        UserID:     request.UserId,
        AccessHash: request.AccessHash,
    })

this error occured when I want to retrieve not contact user.

golanguzb70 commented 1 month ago

Dear @ernado

Can you focus on this issue?