Skip to content

Commit

Permalink
deps: поднята версия tgbotapi до 9.00 и ktor до 2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Djaler committed Jul 5, 2023
1 parent 548ab75 commit ecbc082
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ dependencies {
implementation("org.postgresql:postgresql")
implementation("org.flywaydb:flyway-core")

implementation("dev.inmo:tgbotapi:5.2.1")
implementation("dev.inmo:tgbotapi:9.0.0")

implementation("io.ktor:ktor-server-netty:2.1.3")
implementation("io.ktor:ktor-client-apache:2.1.3")
implementation("io.ktor:ktor-client-content-negotiation:2.1.3")
implementation("io.ktor:ktor-serialization-jackson:2.1.3")
implementation("io.ktor:ktor-server-netty:2.3.2")
implementation("io.ktor:ktor-client-apache:2.3.2")
implementation("io.ktor:ktor-client-content-negotiation:2.3.2")
implementation("io.ktor:ktor-serialization-jackson:2.3.2")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CommandMessageFilter(
private val command: Array<String>,
botInfo: ExtendedBot
) : MessageFilter {
private val botUsername = botInfo.username.username
private val botUsername = botInfo.username

override suspend fun filter(message: Message): Boolean {
if (message !is CommonMessage<*>) {
Expand All @@ -26,7 +26,8 @@ class CommandMessageFilter(
if (command[0].lowercase() !in this.command) {
return false
}
if (command.size > 1 && "@${command[1].lowercase()}" != botUsername.lowercase()) {
if (command.size > 1 && botUsername != null
&& command[1].lowercase() != botUsername.usernameWithoutAt.lowercase()) {
return false
}

Expand Down

0 comments on commit ecbc082

Please sign in to comment.