Browse Source

Updated /dev command

pull/51/head
Ricardo Balk 4 years ago
parent
commit
d237ed95e3
No known key found for this signature in database
GPG Key ID: 52866F2EC2ABD789
  1. 33
      cmdDev.go

33
cmdDev.go

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// +build !rm_basic_commands allcommands devcmd
package main
import (
"fmt"
"strings"
)
func init() {
command := Command{
Cmd: []string{"dev"},
Description: "- Switch to dev channels",
Help: "",
Exec: cmdDev,
}
RegisterCommand(command)
}
func cmdDev(cmd []string) {
dev = !dev
printInfo(fmt.Sprintf("You have toggled the dev flag to %+v", dev))
if (lastChat != "") {
// Switching from regular to dev mode? Dev chats don't use channels. Let's strip the channel name.
n := ""
if (dev) { n = strings.Split(lastChat, "#")[0] } else { n = lastChat }
cmdJoin([]string{"/join", n})
}
go updateChatWindow() // Otherwise you won't be able to process incoming messages.
}
Loading…
Cancel
Save