Browse Source

Ensure login-token is given enough parameters

Tulir Asokan 2 years ago
parent
commit
f424838f0b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      commands.go

+ 4 - 0
commands.go

@@ -75,6 +75,10 @@ var cmdLoginToken = &commands.FullHandler{
 }
 }
 
 
 func fnLoginToken(ce *WrappedCommandEvent) {
 func fnLoginToken(ce *WrappedCommandEvent) {
+	if len(ce.Args) == 0 {
+		ce.Reply("**Usage**: `$cmdprefix login-token <token>`")
+		return
+	}
 	ce.MarkRead()
 	ce.MarkRead()
 	defer ce.Redact()
 	defer ce.Redact()
 	if ce.User.IsLoggedIn() {
 	if ce.User.IsLoggedIn() {