-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/join #45
Feature/join #45
Conversation
[r|**Join** | ||
Repeats the input with some interspersed string or emoji. | ||
|
||
*Usage:* `join :clap: This text will be interspersed with claps!`|] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe clarify that the first word will be used as the string.
clap :: Command | ||
clap = Command "clap" (parseComm clappytime) | ||
where | ||
clappytime :: RestOfInput Text -> Message -> DatabaseDiscord () | ||
clappytime (ROI t) m = | ||
sendMessage m $ | ||
joinify ":clap:" $ | ||
splitOn " " t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do clappytime :: Either (Quote Text, RestOfInput Text) RestOfInput Text -> Message -> DatabaseDiscord ()
to allow users to join with a string containing spaces:
join "x y" a b c d e
x y a x y b x y c x y d x y e
src/Tablebot/Plugins/Join.hs
Outdated
import Text.RawString.QQ | ||
|
||
joinify :: Text -> [Text] -> Text | ||
joinify sep text = sep <> " " <> (intercalate (" " <> sep <> " ") text) <> " " <> sep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this checks every space:
join x a b c d e
x a x b x x c x x x d x x x x e
One more bug:
You could make a new exception ( |
-- Stability : experimental | ||
-- Portability : POSIX | ||
-- | ||
-- A command that outputs its input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description isn't correct
Added a clap and join command, as described in #44