Skip to content

Commit

Permalink
fix: skip ack reaction on ignored messages (#45)
Browse files Browse the repository at this point in the history
* fix: skip ack reaction on ignored message

* fix: remove unnecessary import

---------

Co-authored-by: yuua <yuuahp@icloud.com>
  • Loading branch information
yuuahp and yuua authored Oct 29, 2023
1 parent 4520067 commit 08fa33a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import com.kotlindiscord.kord.extensions.checks.anyGuild
import com.kotlindiscord.kord.extensions.checks.isNotBot
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.event
import com.kotlindiscord.kord.extensions.utils.addReaction
import com.kotlindiscord.kord.extensions.utils.deleteOwnReaction
import com.kotlindiscord.kord.extensions.utils.respond
import dev.kord.core.event.message.MessageCreateEvent

Expand Down Expand Up @@ -44,11 +42,7 @@ class NewMessageEvent : Extension() {

if (message.content.startsWith(VCSpeaker.prefix)) return@action

message.addReaction("πŸ‘€")

guild.narrator()?.queueUser(message) // Not bot

message.deleteOwnReaction("πŸ‘€")
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/com/jaoafa/vcspeaker/voicetext/Narrator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.jaoafa.vcspeaker.voicetext.MessageProcessor.processMessage
import com.jaoafa.vcspeaker.voicetext.NarratorExtensions.announce
import com.jaoafa.vcspeaker.voicetext.TextProcessor.extractInlineVoice
import com.jaoafa.vcspeaker.voicetext.TextProcessor.processText
import com.kotlindiscord.kord.extensions.utils.addReaction
import com.kotlindiscord.kord.extensions.utils.deleteOwnReaction
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer
import dev.kord.common.annotation.KordVoice
import dev.kord.common.entity.Snowflake
Expand Down Expand Up @@ -65,7 +67,11 @@ class Narrator @OptIn(KordVoice::class) constructor(

if (replacedText.isBlank()) return

message?.addReaction("πŸ‘€")

scheduler.queue(message, replacedText, inlineVoice)

message?.deleteOwnReaction("πŸ‘€")
}

/**
Expand Down

0 comments on commit 08fa33a

Please sign in to comment.