Kaynağa Gözat

CommandHelp: don't print cmdprefix in management room

In the management room the user don't need to prefix the commands with the
command-prefix. Hence, don't show the prefix in the command list.
Jörg Sommer 6 yıl önce
ebeveyn
işleme
ae2ccb0d38
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      commands.go

+ 5 - 1
commands.go

@@ -121,7 +121,11 @@ const cmdHelpHelp = `help - Prints this help`
 
 // CommandHelp handles help command
 func (handler *CommandHandler) CommandHelp(ce *CommandEvent) {
-	cmdPrefix := handler.bridge.Config.Bridge.CommandPrefix + " "
+	cmdPrefix := ""
+	if ce.User.ManagementRoom != ce.RoomID {
+		cmdPrefix = handler.bridge.Config.Bridge.CommandPrefix + " "
+	}
+
 	ce.Reply(strings.Join([]string{
 		cmdPrefix + cmdHelpHelp,
 		cmdPrefix + cmdLoginHelp,