From 4790b763c75c8fe4f70127af03f1160eb28c3026 Mon Sep 17 00:00:00 2001 From: Ayrat Hudaygulov Date: Mon, 22 Jul 2024 19:17:00 +0100 Subject: [PATCH] fixed? --- src/VahterBanBot.Tests/MLBanTests.fs | 4 ++-- src/VahterBanBot/DB.fs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/VahterBanBot.Tests/MLBanTests.fs b/src/VahterBanBot.Tests/MLBanTests.fs index 9cadd33..944416f 100644 --- a/src/VahterBanBot.Tests/MLBanTests.fs +++ b/src/VahterBanBot.Tests/MLBanTests.fs @@ -71,7 +71,7 @@ type MLBanTests(fixture: VahterTestContainers, _unused: MlAwaitFixture) = let ``If message got auto-deleted we can mark it as false-positive with a button click`` () = task { // record a message, where 2 is in a training set as spam word // ChatsToMonitor[0] doesn't have stopwords - let msgUpdate = Tg.quickMsg(chat = fixture.ChatsToMonitor[0], text = "2") + let msgUpdate = Tg.quickMsg(chat = fixture.ChatsToMonitor[0], text = "7") let! _ = fixture.SendMessage msgUpdate // assert that the message got auto banned @@ -105,7 +105,7 @@ type MLBanTests(fixture: VahterTestContainers, _unused: MlAwaitFixture) = // send a callback to mark it as false-positive // we are sending this as a usual user let! callbackId = fixture.GetCallbackId msgUpdate.Message (nameof CallbackMessage.NotASpam) - let msgCallback = Tg.callback(string callbackId) + let msgCallback = Tg.callback(string callbackId, from = msgUpdate.Message.From) let! _ = fixture.SendMessage msgCallback // assert it is still NOT a false-positive diff --git a/src/VahterBanBot/DB.fs b/src/VahterBanBot/DB.fs index 34ac93d..a2f7c6f 100644 --- a/src/VahterBanBot/DB.fs +++ b/src/VahterBanBot/DB.fs @@ -166,7 +166,7 @@ let getUserById (userId: int64): Task = use conn = new NpgsqlConnection(connString) //language=postgresql - let sql = "SELECT * FROM \"user\" WHERE id = @userId" + let sql = """SELECT * FROM "user" WHERE id = @userId""" let! users = conn.QueryAsync(sql, {| userId = userId |}) return users |> Seq.tryHead }