added isRoot Command
This commit is contained in:
10
utils.go
10
utils.go
@ -47,3 +47,13 @@ func hasCommandPrefix(s string, baseCommand string, botName string, subCommands
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isRootCommand determines if the command is the root command or name with no arguments
|
||||||
|
func isRootCommand(s string, baseCommand string, botName string) bool {
|
||||||
|
botCommand := fmt.Sprintf("!%s", baseCommand)
|
||||||
|
nameCommand := fmt.Sprintf("@%s", botName)
|
||||||
|
if s == botCommand || s == nameCommand {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user