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

Update Telegram schema to the latest layer #1223

Merged
merged 4 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
- ubuntu-latest
- macos-latest
include:
- arch: 386
go: "1.21"
runner: ubuntu-latest

- arch: amd64
runner: windows-latest
go: "1.21"
Expand Down
6 changes: 3 additions & 3 deletions _schema/layer.tl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Code generated by ./cmd/dltl, DO NOT EDIT.
//
// Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/layer.tl
// Layer: 165
// SHA256: 36b1cc02020b7961dbbce32a3b05ecc9409c447b0b202854a07c47676c665fa9
// Layer: 166
// SHA256: a0dbdfb46897445f2eb0ba70df15f042172b668dfbdd11f7fd12c3fb0af29837

// LAYER 165
// LAYER 166
120 changes: 84 additions & 36 deletions _schema/tdesktop.tl

Large diffs are not rendered by default.

124 changes: 86 additions & 38 deletions _schema/telegram.tl

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/golang/snappy v0.0.4 // indirect
github.com/gotd/ige v0.2.2 // indirect
github.com/gotd/neo v0.1.5 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -44,7 +44,7 @@ require (
golang.org/x/exp v0.0.0-20230116083435-1de6713980de // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
nhooyr.io/websocket v1.8.10 // indirect
rsc.io/qr v0.2.0 // indirect
)

Expand Down
2 changes: 2 additions & 0 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down Expand Up @@ -404,5 +405,6 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY=
rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs=
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/go-faster/jx v1.1.0
github.com/go-faster/xor v1.0.0
github.com/go-openapi/inflect v0.19.0
github.com/gotd/getdoc v0.33.0
github.com/gotd/getdoc v0.34.0
github.com/gotd/ige v0.2.2
github.com/gotd/neo v0.1.5
github.com/gotd/tl v0.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12f
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/gotd/getdoc v0.33.0 h1:SuhzZGPkKmc1UujqMK9I2sZhZ0CVmopC/b+9uG5+7r4=
github.com/gotd/getdoc v0.33.0/go.mod h1:qzfE27A4jhjLh1jTtwryuS0J3x2sRvQyzVYPfuZ17Yk=
github.com/gotd/getdoc v0.34.0 h1:Zx+SW9LYgksInerjl2Tr+i8XdrNAky/VOn3EF54gcOI=
github.com/gotd/getdoc v0.34.0/go.mod h1:qzfE27A4jhjLh1jTtwryuS0J3x2sRvQyzVYPfuZ17Yk=
github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk=
github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0=
github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ=
Expand Down
8 changes: 5 additions & 3 deletions telegram/message/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type Builder struct {
// noForwards whether that sent message cannot be forwarded.
noForwards bool

// The message ID to which this message will reply to.
replyToMsgID int
// The reply target.
replyTo tg.InputReplyToClass
// Reply markup for sending bot buttons.
replyMarkup tg.ReplyMarkupClass
// Scheduled message date for scheduled messages.
Expand Down Expand Up @@ -73,7 +73,9 @@ func (b *Builder) Clear() *Builder {

// Reply sets message ID to reply.
func (b *Builder) Reply(id int) *Builder {
b.replyToMsgID = id
b.replyTo = &tg.InputReplyToMessage{
ReplyToMsgID: id,
}
return b
}

Expand Down
2 changes: 1 addition & 1 deletion telegram/message/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestBuilder(t *testing.T) {
a.True(b.noWebpage)

b = b.ReplyMsg(&tg.Message{ID: 10})
a.Equal(10, b.replyToMsgID)
a.Equal(10, b.replyTo.(*tg.InputReplyToMessage).ReplyToMsgID)

date := time.Now()
b = b.Schedule(date)
Expand Down
10 changes: 5 additions & 5 deletions telegram/message/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func (b *Builder) saveDraftRequest(
entities []tg.MessageEntityClass,
) *tg.MessagesSaveDraftRequest {
return &tg.MessagesSaveDraftRequest{
NoWebpage: b.noWebpage,
Peer: peer,
ReplyToMsgID: b.replyToMsgID,
Message: msg,
Entities: entities,
NoWebpage: b.noWebpage,
Peer: peer,
ReplyTo: b.replyTo,
Message: msg,
Entities: entities,
}
}

Expand Down
38 changes: 19 additions & 19 deletions telegram/message/entity/options.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion telegram/message/inline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (b *Builder) InlineResult(ctx context.Context, id string, queryID int64, hi
ClearDraft: b.clearDraft,
HideVia: hideVia,
Peer: p,
ReplyTo: &tg.InputReplyToMessage{ReplyToMsgID: b.replyToMsgID},
ReplyTo: b.replyTo,
QueryID: queryID,
ID: id,
ScheduleDate: b.scheduleDate,
Expand Down
4 changes: 2 additions & 2 deletions telegram/message/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (b *Builder) Album(ctx context.Context, media MultiMediaOption, album ...Mu
Background: b.background,
ClearDraft: b.clearDraft,
Peer: p,
ReplyTo: &tg.InputReplyToMessage{ReplyToMsgID: b.replyToMsgID},
ReplyTo: b.replyTo,
MultiMedia: mb,
ScheduleDate: b.scheduleDate,
})
Expand Down Expand Up @@ -112,7 +112,7 @@ func (b *Builder) Media(ctx context.Context, media MediaOption) (tg.UpdatesClass
Background: b.background,
ClearDraft: b.clearDraft,
Peer: p,
ReplyTo: &tg.InputReplyToMessage{ReplyToMsgID: b.replyToMsgID},
ReplyTo: b.replyTo,
Media: attachment.Media,
Message: attachment.Message,
ReplyMarkup: b.replyMarkup,
Expand Down
20 changes: 10 additions & 10 deletions telegram/message/styling/options.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion telegram/message/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (b *Builder) sendRequest(
ClearDraft: b.clearDraft,
Noforwards: b.noForwards,
Peer: p,
ReplyTo: &tg.InputReplyToMessage{ReplyToMsgID: b.replyToMsgID},
ReplyTo: b.replyTo,
Message: msg,
RandomID: 0,
ReplyMarkup: b.replyMarkup,
Expand Down
84 changes: 84 additions & 0 deletions telegram/query/cached/queries.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading