mirror of https://github.com/kami-blue/client
[fix] Cleaned up and fixed DiscordNotifsCommand regex (#1814)
*it was the 2*
This commit is contained in:
parent
b6f9b19009
commit
b6327e5dc4
|
@ -10,17 +10,18 @@ object DiscordNotifsCommand : ClientCommand(
|
|||
name = "discordnotifs",
|
||||
alias = arrayOf("webhook")
|
||||
) {
|
||||
private val urlRegex = Regex("^https://.*discord\\.com/api/webhooks/([0-9])+/.{68}$2")
|
||||
private val urlRegex = Regex("^https://.*discord\\.com/api/webhooks/\\d+/.{68}")
|
||||
|
||||
init {
|
||||
literal("id") {
|
||||
long("discord user id") { idArg ->
|
||||
execute("Set the ID of the user to be pinged") {
|
||||
DiscordNotifs.pingID.value = idArg.value.toString()
|
||||
|
||||
MessageSendHelper.sendChatMessage(urlRegex.matches("https://ptb.discord.com/api/webhooks/791291547592687626/ZcYa1pdaOcgTMzimKePOyxieuVj8abDBMDBEtg30npXHryIa0NEGCwxTYXS9AOKUbggB").toString())
|
||||
MessageSendHelper.sendChatMessage("Set Discord User ID to ${formatValue(idArg.value.toString())}!")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
literal("avatar") {
|
||||
|
@ -39,6 +40,7 @@ object DiscordNotifsCommand : ClientCommand(
|
|||
formatValue(urlArg.value) +
|
||||
" does not match the valid webhook format!"
|
||||
)
|
||||
|
||||
return@execute
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue