remove chat command support to keep it slash only
This commit is contained in:
parent
c8063772ad
commit
f9b2a02e55
@ -17,21 +17,6 @@ private val TOKEN = env("TOKEN") // Get the bot' token from the env vars or a
|
|||||||
|
|
||||||
suspend fun main() {
|
suspend fun main() {
|
||||||
val bot = ExtensibleBot(TOKEN) {
|
val bot = ExtensibleBot(TOKEN) {
|
||||||
chatCommands {
|
|
||||||
defaultPrefix = "?"
|
|
||||||
enabled = true
|
|
||||||
|
|
||||||
prefix { default ->
|
|
||||||
if (guildId == TEST_SERVER_ID) {
|
|
||||||
// For the test server, we use ! as the command prefix
|
|
||||||
"!"
|
|
||||||
} else {
|
|
||||||
// For other servers, we use the configured default prefix
|
|
||||||
default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extensions {
|
extensions {
|
||||||
add(::TestExtension)
|
add(::TestExtension)
|
||||||
}
|
}
|
||||||
|
@ -18,57 +18,6 @@ class TestExtension : Extension() {
|
|||||||
override val name = "test"
|
override val name = "test"
|
||||||
|
|
||||||
override suspend fun setup() {
|
override suspend fun setup() {
|
||||||
chatCommand(::SlapArgs) {
|
|
||||||
name = Translations.Commands.Slap.name
|
|
||||||
description = Translations.Commands.Slap.description
|
|
||||||
|
|
||||||
check { failIf(event.message.author == null) }
|
|
||||||
|
|
||||||
action {
|
|
||||||
// Don't slap ourselves on request, slap the requester!
|
|
||||||
val realTarget = if (arguments.target.id == event.kord.selfId) {
|
|
||||||
message.author!!
|
|
||||||
} else {
|
|
||||||
arguments.target
|
|
||||||
}
|
|
||||||
|
|
||||||
message.respond(
|
|
||||||
Translations.Commands.Slap.response
|
|
||||||
.withContext(this)
|
|
||||||
.translateNamed(
|
|
||||||
"target" to realTarget.mention,
|
|
||||||
"weapon" to arguments.weapon
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
chatCommand {
|
|
||||||
name = Translations.Commands.Button.name
|
|
||||||
description = Translations.Commands.Button.description
|
|
||||||
|
|
||||||
check { failIf(event.message.author == null) }
|
|
||||||
|
|
||||||
action {
|
|
||||||
message.respond {
|
|
||||||
components {
|
|
||||||
publicButton {
|
|
||||||
label = Translations.Components.Button.label
|
|
||||||
.withLocale(this@action.getLocale())
|
|
||||||
|
|
||||||
action {
|
|
||||||
respond {
|
|
||||||
content = Translations.Components.Button.response
|
|
||||||
.withLocale(getLocale())
|
|
||||||
.translate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publicSlashCommand(::SlapSlashArgs) {
|
publicSlashCommand(::SlapSlashArgs) {
|
||||||
name = Translations.Commands.Slap.name
|
name = Translations.Commands.Slap.name
|
||||||
description = Translations.Commands.Slap.description
|
description = Translations.Commands.Slap.description
|
||||||
|
Loading…
x
Reference in New Issue
Block a user