File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -166,13 +166,16 @@ type BaseEdit struct {
166166func (edit BaseEdit ) values () (url.Values , error ) {
167167 v := url.Values {}
168168
169- if edit .ChannelUsername != "" {
170- v .Add ("chat_id" , edit .ChannelUsername )
169+ if edit .InlineMessageID == "" {
170+ if edit .ChannelUsername != "" {
171+ v .Add ("chat_id" , edit .ChannelUsername )
172+ } else {
173+ v .Add ("chat_id" , strconv .FormatInt (edit .ChatID , 10 ))
174+ }
175+ v .Add ("message_id" , strconv .Itoa (edit .MessageID ))
171176 } else {
172- v .Add ("chat_id " , strconv . FormatInt ( edit .ChatID , 10 ) )
177+ v .Add ("inline_message_id " , edit .InlineMessageID )
173178 }
174- v .Add ("message_id" , strconv .Itoa (edit .MessageID ))
175- v .Add ("inline_message_id" , edit .InlineMessageID )
176179
177180 if edit .ReplyMarkup != nil {
178181 data , err := json .Marshal (edit .ReplyMarkup )
You can’t perform that action at this time.
0 commit comments