Browse Source

fix average joke and update logi

master
Gil Mizrahi 9 months ago
parent
commit
482bfd9fa8
4 changed files with 8 additions and 7 deletions
  1. +2
    -1
      src/Logi.hs
  2. +1
    -1
      src/Sephibot.hs
  3. +1
    -1
      stack.yaml
  4. +4
    -4
      stack.yaml.lock

+ 2
- 1
src/Logi.hs View File

@@ -14,6 +14,7 @@ import qualified Data.Map as M
import System.Timeout
import System.Mem
import Discord.Types
import System.IO.Unsafe (unsafePerformIO)

import Language.Logi
import Types
@@ -26,7 +27,7 @@ runCode mystate gid name (Code code) = do
randseed <- readTVar (mystate ^. randomSeed)
let
initialKnowledge = maybe defaultKnowledge id $ M.lookup gid (db ^. logiKnowledge)
case execs randseed initialKnowledge name code of
case unsafePerformIO $ execs randseed initialKnowledge name code of
Left err ->
pure [Code $ "Error: " <> ppErr err]
Right (results, Ctx knowledge randseed') -> do


+ 1
- 1
src/Sephibot.hs View File

@@ -98,7 +98,7 @@ handleMessage mystate message = do
| "אתה " `T.isPrefixOf` txt && "?" `T.isSuffixOf` txt -> do
let
thing = (T.drop 4 . T.reverse . T.dropWhile (=='?') . T.reverse) txt
if thing == "ממוצע"
if thing /= "ממוצע"
then do
react message "japanese_ogre"
sendMsg message $ "לא " <> thing <> " ולא כלום"


+ 1
- 1
stack.yaml View File

@@ -13,7 +13,7 @@ extra-deps:
- git: https://gitlab.com/gilmi/simple-file-db.git
commit: 0d05f69f3f677642dea41bcf1660db5a8e727bc7
- git: https://gitlab.com/gilmi/logi.git
commit: 1692f9b6cc6d8a667b5a9f6c284fa8915ca1a88a
commit: 58d23adffcba4085b4cd30ebf99e77f757bbf49e
- haskeline-0.8.1.0@sha256:6a6158c90b929ce7aa5331ff5e9819aa32c7df8f4a7ba324b3cc055ee96b48cb,5818
- repline-0.4.0.0@sha256:3324479e497d27c40c3d4762bffc52058f9921621d20d2947dcf9a554b94cd0d,2253


+ 4
- 4
stack.yaml.lock View File

@@ -34,12 +34,12 @@ packages:
version: 0.1.0
git: https://gitlab.com/gilmi/logi.git
pantry-tree:
size: 1376
sha256: b02fb2d951309648ae61011817d1397451d783cff57ed109e455ee1d5fd4166a
commit: 1692f9b6cc6d8a667b5a9f6c284fa8915ca1a88a
size: 1494
sha256: c80e6d9cbc1fe3569967eaf959e4d4a3e7679097271ddd3c2055ccc18657388a
commit: 58d23adffcba4085b4cd30ebf99e77f757bbf49e
original:
git: https://gitlab.com/gilmi/logi.git
commit: 1692f9b6cc6d8a667b5a9f6c284fa8915ca1a88a
commit: 58d23adffcba4085b4cd30ebf99e77f757bbf49e
- completed:
hackage: haskeline-0.8.1.0@sha256:6a6158c90b929ce7aa5331ff5e9819aa32c7df8f4a7ba324b3cc055ee96b48cb,5818
pantry-tree:


Loading…
Cancel
Save