Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/main/kotlin/org/openredstone/chad/Chad.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun main(args: Array<String>) = runBlocking {
val discordServer = discordApi.getServerById(chadConfig.serverId)
.orElseThrow { NoSuchElementException("Server not found") }

val commands = concurrentMapOf<String, Command>()
val commands = concurrentMapOf<String, Command>()

fun regenerateHelpCommand() {
commands["help"] = helpCommand(commands)
Expand All @@ -76,6 +76,7 @@ fun main(args: Array<String>) = runBlocking {
fun reloadCommands() {
chadConfig = config[ChadSpec.chad]
val authorizedRoles = chadConfig.authorizedDiscordRoles
val noTouchy = arrayOf<String>("conv", "poll", "lmgtfy", "apply", "insult", "add", "remove", "issue", "delete", "pikl", "authorized", "reload")

logger.info("(Re)loading commands...")

Expand All @@ -97,14 +98,19 @@ fun main(args: Array<String>) = runBlocking {
val name by required()
val messages by vararg()
reply {
val msg = messages.joinToString(separator = " ")
val cmd = command {
reply { msg }
if (name.toString() in noTouchy) {
"u no touchy my commandy"
} else {
val msg = messages.joinToString(separator = " ")
val cmd = command {
reply { msg }
}

database.insertCommand(name, msg)
commands[name] = cmd
regenerateHelpCommand()
"Done!"
}
database.insertCommand(name, msg)
commands[name] = cmd
regenerateHelpCommand()
"Done!"
}
})
put("remove", command(authorizedRoles) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/openredstone/chad/commands/Command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ fun deleteCommand(authorizedRoles: List<String>, discordApi: DiscordApi, chadCon
)
setColor(Color.RED)
setFooter("FootORE")
setThumbnail("https://cdn.discordapp.com/emojis/892499052942463027.webp")
setThumbnail("https://cdn.discordapp.com/emojis/892499052942463027.webp") // big bruh momnet
}
MessageBuilder().copy(target).addEmbed(embed).send(removedContentChannel).await()
target.delete().await()
Expand Down