Skip to content

Commit

Permalink
fix(chatCommands): ignore webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mazziechai committed Dec 1, 2024
1 parent 96df360 commit a975040
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class ChatCommandsExtension : Extension() {
check { anyGuild() }

action {
if (user == null) {
return@action
}

val note = noteCollection.getRandomNote(guild!!.id, arguments.noteName)

if (note == null) {
Expand All @@ -43,7 +47,6 @@ class ChatCommandsExtension : Extension() {
val referenceRegex = Regex("\\{\\{(.+?)}}")
val references = referenceRegex.findAll(note.content).distinctBy { it.groupValues[1] }


message.respond {
content = "${note.content}\n\n`#%06x` `%s`".format(note._id, note.name)
if (references.any()) {
Expand Down

0 comments on commit a975040

Please sign in to comment.