mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 09:57:24 +00:00
Update helptext + download?
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"download", "d"},
|
Cmd: []string{"download", "d"},
|
||||||
Description: "Download a file",
|
Description: "/d $messageId $fileName - Download a file to user's downloadpath",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdDownloadFile,
|
Exec: cmdDownloadFile,
|
||||||
}
|
}
|
||||||
@ -20,7 +20,12 @@ func init() {
|
|||||||
|
|
||||||
func cmdDownloadFile(cmd []string) {
|
func cmdDownloadFile(cmd []string) {
|
||||||
messageID, _ := strconv.Atoi(cmd[1])
|
messageID, _ := strconv.Atoi(cmd[1])
|
||||||
fileName := cmd[2]
|
var fileName string
|
||||||
|
if len(cmd) == 3 {
|
||||||
|
fileName = cmd[2]
|
||||||
|
} else {
|
||||||
|
fileName = ""
|
||||||
|
}
|
||||||
|
|
||||||
chat := k.NewChat(channel)
|
chat := k.NewChat(channel)
|
||||||
_, err := chat.Download(messageID, fmt.Sprintf("%s/%s", downloadPath, fileName))
|
_, err := chat.Download(messageID, fmt.Sprintf("%s/%s", downloadPath, fileName))
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"help", "h"},
|
Cmd: []string{"help", "h"},
|
||||||
Description: "Show information about avaailable commands",
|
Description: "/h Show information about available commands",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdHelp,
|
Exec: cmdHelp,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"join", "j"},
|
Cmd: []string{"join", "j"},
|
||||||
Description: "Join a channel",
|
Description: "/j $team/user $channel - Join a chat, $user or $team $channel",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdJoin,
|
Exec: cmdJoin,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import "strconv"
|
|||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"react", "r", "+"},
|
Cmd: []string{"react", "r", "+"},
|
||||||
Description: "React to a message",
|
Description: "/r $messageId $reaction - React to a message (messageID is optional)",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdReact,
|
Exec: cmdReact,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"stream", "s" },
|
Cmd: []string{"stream", "s"},
|
||||||
Description: "Stream all incoming messages",
|
Description: "/s - Stream all incoming messages",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdStream,
|
Exec: cmdStream,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
command := Command{
|
command := Command{
|
||||||
Cmd: []string{"upload", "u"},
|
Cmd: []string{"upload", "u"},
|
||||||
Description: "Upload a file",
|
Description: "/u $filePath $fileName - Upload file with optional name",
|
||||||
Help: "",
|
Help: "",
|
||||||
Exec: cmdUploadFile,
|
Exec: cmdUploadFile,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user