|
|
|
@ -21,6 +21,7 @@ type chatOutMessage struct {
@@ -21,6 +21,7 @@ type chatOutMessage struct {
|
|
|
|
|
} |
|
|
|
|
type chatOutOptions struct { |
|
|
|
|
Channel chatOutChannel `json:"channel"` |
|
|
|
|
MessageID int `json:"message_id"` |
|
|
|
|
Message chatOutMessage `json:"message"` |
|
|
|
|
} |
|
|
|
|
type chatOutParams struct { |
|
|
|
@ -110,6 +111,38 @@ func (k Keybase) ChatSendTextTeam(team, channel string, message ...string) (chat
@@ -110,6 +111,38 @@ func (k Keybase) ChatSendTextTeam(team, channel string, message ...string) (chat
|
|
|
|
|
return r.Result, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ChatSendReaction() sends a reaction to a user's message.
|
|
|
|
|
func (k Keybase) ChatSendReaction(user, reaction string, messageId int) (chatOutResultResult, error) { |
|
|
|
|
m := chatOut{} |
|
|
|
|
m.Method = "reaction" |
|
|
|
|
m.Params.Options.Channel.Name = user |
|
|
|
|
m.Params.Options.MessageID = messageId |
|
|
|
|
m.Params.Options.Message.Body = reaction |
|
|
|
|
|
|
|
|
|
r, err := chatAPIOut(k.path, m) |
|
|
|
|
if err != nil { |
|
|
|
|
return chatOutResultResult{}, err |
|
|
|
|
} |
|
|
|
|
return r.Result, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ChatSendReactionTeam() sends a reaction to a message on a team.
|
|
|
|
|
func (k Keybase) ChatSendReactionTeam(team, channel, reaction string, messageId int) (chatOutResultResult, error) { |
|
|
|
|
m := chatOut{} |
|
|
|
|
m.Method = "reaction" |
|
|
|
|
m.Params.Options.Channel.Name = team |
|
|
|
|
m.Params.Options.Channel.MembersType = "team" |
|
|
|
|
m.Params.Options.Channel.TopicName = channel |
|
|
|
|
m.Params.Options.MessageID = messageId |
|
|
|
|
m.Params.Options.Message.Body = reaction |
|
|
|
|
|
|
|
|
|
r, err := chatAPIOut(k.path, m) |
|
|
|
|
if err != nil { |
|
|
|
|
return chatOutResultResult{}, err |
|
|
|
|
} |
|
|
|
|
return r.Result, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ChatList() returns a list of all conversations.
|
|
|
|
|
func (k Keybase) ChatList() ([]chatOutResultConversations, error) { |
|
|
|
|
m := chatOut{} |
|
|
|
|