Make command matching case-insensitive
This commit is contained in:
parent
f871d2a381
commit
f314c20dd8
|
@ -69,10 +69,10 @@ class Command(cmd: RawCommand) {
|
|||
|
||||
enum class MatchType {
|
||||
PREFIX {
|
||||
override fun matches(message: String, command: Command) = message.startsWith(command.trigger)
|
||||
override fun matches(message: String, command: Command) = message.startsWith(command.trigger, ignoreCase = true)
|
||||
},
|
||||
CONTAINS {
|
||||
override fun matches(message: String, command: Command) = message.contains(command.trigger)
|
||||
override fun matches(message: String, command: Command) = message.contains(command.trigger, ignoreCase = true)
|
||||
},
|
||||
REGEX {
|
||||
override fun matches(message: String, command: Command) = command.regex!!.matches(message)
|
||||
|
|
Loading…
Reference in New Issue
Block a user