fixed root command to have trailing space
This commit is contained in:
5
utils.go
5
utils.go
@ -50,8 +50,9 @@ func hasCommandPrefix(s string, baseCommand string, botName string, subCommands
|
|||||||
|
|
||||||
// isRootCommand determines if the command is the root command or name with no arguments
|
// isRootCommand determines if the command is the root command or name with no arguments
|
||||||
func isRootCommand(s string, baseCommand string, botName string) bool {
|
func isRootCommand(s string, baseCommand string, botName string) bool {
|
||||||
botCommand := fmt.Sprintf("!%s", baseCommand)
|
// the space after is important because keybase autocompletes ! and @ with a space after
|
||||||
nameCommand := fmt.Sprintf("@%s", botName)
|
botCommand := fmt.Sprintf("!%s ", baseCommand)
|
||||||
|
nameCommand := fmt.Sprintf("@%s ", botName)
|
||||||
if s == botCommand || s == nameCommand {
|
if s == botCommand || s == nameCommand {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user