Browse Source

Update helptext + download?

pull/1/head
Gregory Rudolph 5 years ago
parent
commit
898b6369aa
  1. 9
      cmdDownload.go
  2. 2
      cmdHelp.go
  3. 2
      cmdJoin.go
  4. 2
      cmdReact.go
  5. 5
      cmdStream.go
  6. 2
      cmdUploadFile.go
  7. 2
      main.go

9
cmdDownload.go

@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
func init() {
command := Command{
Cmd: []string{"download", "d"},
Description: "Download a file",
Description: "/d $messageId $fileName - Download a file to user's downloadpath",
Help: "",
Exec: cmdDownloadFile,
}
@ -20,7 +20,12 @@ func init() { @@ -20,7 +20,12 @@ func init() {
func cmdDownloadFile(cmd []string) {
messageID, _ := strconv.Atoi(cmd[1])
fileName := cmd[2]
var fileName string
if len(cmd) == 3 {
fileName = cmd[2]
} else {
fileName = ""
}
chat := k.NewChat(channel)
_, err := chat.Download(messageID, fmt.Sprintf("%s/%s", downloadPath, fileName))

2
cmdHelp.go

@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
func init() {
command := Command{
Cmd: []string{"help", "h"},
Description: "Show information about avaailable commands",
Description: "/h Show information about available commands",
Help: "",
Exec: cmdHelp,
}

2
cmdJoin.go

@ -11,7 +11,7 @@ import ( @@ -11,7 +11,7 @@ import (
func init() {
command := Command{
Cmd: []string{"join", "j"},
Description: "Join a channel",
Description: "/j $team/user $channel - Join a chat, $user or $team $channel",
Help: "",
Exec: cmdJoin,
}

2
cmdReact.go

@ -7,7 +7,7 @@ import "strconv" @@ -7,7 +7,7 @@ import "strconv"
func init() {
command := Command{
Cmd: []string{"react", "r", "+"},
Description: "React to a message",
Description: "/r $messageId $reaction - React to a message (messageID is optional)",
Help: "",
Exec: cmdReact,
}

5
cmdStream.go

@ -2,11 +2,10 @@ @@ -2,11 +2,10 @@
package main
func init() {
command := Command{
Cmd: []string{"stream", "s" },
Description: "Stream all incoming messages",
Cmd: []string{"stream", "s"},
Description: "/s - Stream all incoming messages",
Help: "",
Exec: cmdStream,
}

2
cmdUploadFile.go

@ -9,7 +9,7 @@ import ( @@ -9,7 +9,7 @@ import (
func init() {
command := Command{
Cmd: []string{"upload", "u"},
Description: "Upload a file",
Description: "/u $filePath $fileName - Upload file with optional name",
Help: "",
Exec: cmdUploadFile,
}

2
main.go

@ -110,8 +110,6 @@ func formatOutput(api keybase.ChatAPI) string { @@ -110,8 +110,6 @@ func formatOutput(api keybase.ChatAPI) string {
return ret
}
func populateList() {
_, maxY := g.Size()
if testVar, err := k.ChatList(); err != nil {

Loading…
Cancel
Save