Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
Browse files Browse the repository at this point in the history
…to dice-stats
  • Loading branch information
L0neGamer committed Jan 12, 2022
2 parents 8b0498a + 2a7921b commit 7890b7c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tablebot
version: 0.1.0.0
version: 0.3.1
github: "WarwickTabletop/tablebot"
license: MIT
author: "Warwick Tabletop"
Expand Down
1 change: 1 addition & 0 deletions src/Tablebot/Plugins/Netrunner/Command/Search.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ fixSearch api = mapMaybe fix
format ("c", sep, v) = Just $ QInt "c" sep cycleIndex $ map fixCycle v
format ("t", sep, v) = Just $ QText "t" sep typeCode $ map fixType v
format ("f", sep, v) = Just $ QText "f" sep keywords $ map fixFaction v
format ("s", sep, v) = Just $ QText "s" sep keywords v
format ("d", sep, v) = Just $ QText "d" sep sideCode $ map fixSide v
format ("i", sep, v) = Just $ QText "i" sep illustrator v
format ("o", sep, v) = Just $ QInt "o" sep cost v
Expand Down
7 changes: 5 additions & 2 deletions src/Tablebot/Utility/Discord.hs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,11 @@ findEmoji ename = fmap msum (liftDiscord readCache >>= cacheToEmoji)

-- | Render an Emoji
formatEmoji :: Emoji -> Text
formatEmoji (Emoji (Just eId) eName _ _ _) = "<:" <> eName <> ":" <> pack (show eId) <> ">"
formatEmoji (Emoji _ eName _ _ _) = eName
formatEmoji (Emoji (Just eId) eName _ _ _ anim) = prefix anim <> eName <> ":" <> pack (show eId) <> ">"
where
prefix (Just True) = "<a:"
prefix _ = "<:"
formatEmoji (Emoji _ eName _ _ _ _) = eName

-- | Display an emoji as best as it can from its name
formatFromEmojiName :: Text -> EnvDatabaseDiscord s Text
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages:
# allow-newer: true

extra-deps:
- discord-haskell-1.9.2
- discord-haskell-1.10.0
- emoji-0.1.0.2
- load-env-0.2.1.0
- megaparsec-9.0.1
Expand Down

0 comments on commit 7890b7c

Please sign in to comment.