From 67ffd89a004260953a4c0f851adef356f356a127 Mon Sep 17 00:00:00 2001
From: Sam <dxb@keybase.io>
Date: Sun, 16 Feb 2020 22:11:08 -0500
Subject: [PATCH] Add delete message funcs

---
 chat.go | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/chat.go b/chat.go
index 30c93eb..057deba 100644
--- a/chat.go
+++ b/chat.go
@@ -387,19 +387,37 @@ func (k *Keybase) ReactByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, m
 	return r, nil
 }
 
-// Delete deletes a chat message
-func (c Chat) Delete(messageID int) (ChatAPI, error) {
-	m := ChatAPI{
-		Params: &params{},
+// DeleteByChannel reacts to a message in a channel
+func (k *Keybase) DeleteByChannel(channel chat1.ChatChannel, msgID chat1.MessageID) (SendResponse, error) {
+	var r SendResponse
+
+	opts := SendMessageOptions{
+		Channel:   channel,
+		MessageID: msgID,
 	}
-	m.Method = "delete"
-	m.Params.Options.Channel = &c.Channel
-	m.Params.Options.MessageID = messageID
 
-	r, err := chatAPIOut(c.keybase, m)
+	r, err := k.SendMessage("delete", opts)
 	if err != nil {
 		return r, err
 	}
+
+	return r, nil
+}
+
+// DeleteByConvID reacts to a message in a conversation id
+func (k *Keybase) DeleteByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID) (SendResponse, error) {
+	var r SendResponse
+
+	opts := SendMessageOptions{
+		ConversationID: convID,
+		MessageID:      msgID,
+	}
+
+	r, err := k.SendMessage("delete", opts)
+	if err != nil {
+		return r, err
+	}
+
 	return r, nil
 }