|
|
@ -8,7 +8,6 @@ import ( |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"os/exec" |
|
|
|
"os/exec" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"samhofi.us/x/keybase/types/chat1" |
|
|
|
"samhofi.us/x/keybase/types/chat1" |
|
|
@ -348,26 +347,6 @@ func (k *Keybase) EditToConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, me |
|
|
|
return r, nil |
|
|
|
return r, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Edit edits a previously sent chat message
|
|
|
|
|
|
|
|
func (c Chat) Edit(messageID int, message ...string) (ChatAPI, error) { |
|
|
|
|
|
|
|
m := ChatAPI{ |
|
|
|
|
|
|
|
Params: ¶ms{}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
m.Params.Options = options{ |
|
|
|
|
|
|
|
Message: &mesg{}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
m.Method = "edit" |
|
|
|
|
|
|
|
m.Params.Options.Channel = &c.Channel |
|
|
|
|
|
|
|
m.Params.Options.Message.Body = strings.Join(message, " ") |
|
|
|
|
|
|
|
m.Params.Options.MessageID = messageID |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r, err := chatAPIOut(c.keybase, m) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return r, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return r, nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// React sends a reaction to a message.
|
|
|
|
// React sends a reaction to a message.
|
|
|
|
func (c Chat) React(messageID int, reaction string) (ChatAPI, error) { |
|
|
|
func (c Chat) React(messageID int, reaction string) (ChatAPI, error) { |
|
|
|
m := ChatAPI{ |
|
|
|
m := ChatAPI{ |
|
|
|