Safe Haskell | None |
---|---|
Language | Haskell2010 |
Things for formatting things
Synopsis
- codeblock :: Text -> Text -> Text
- codeblock' :: Maybe Text -> Text -> Text
- codeline :: Text -> Text
- escapeCodeblocks :: Text -> Text
- escapeCodelines :: Text -> Text
- escapeBold :: Text -> Text
- escapeStrike :: Text -> Text
- escapeUnderline :: Text -> Text
- escapeSpoilers :: Text -> Text
- escapeFormatting :: Text -> Text
- bold :: Text -> Text
- strike :: Text -> Text
- underline :: Text -> Text
- quote :: Text -> Text
- quoteAll :: Text -> Text
- spoiler :: Text -> Text
- zws :: IsString s => s
- fmtEmoji :: Emoji -> Text
- displayUser :: (HasField' "username" a Text, HasField' "discriminator" a Text) => a -> Text
- class Mentionable a where
Documentation
Formats a lang and content into a codeblock
>>>
codeblock "hs" "x = y"
"```hs\nx = y\n```"
Any codeblocks in the content
are escaped
Formats an optional lang and content into a codeblock
Any codeblocks in the content
are escaped
codeline :: Text -> Text Source #
Formats some content into a code line
This always uses ``
code lines as they can be escaped
Any code lines in the content are escaped
escapeCodeblocks :: Text -> Text Source #
Replaces all occurences of ```
with `<zws>`<zws>`
escapeCodelines :: Text -> Text Source #
Replaces all occurences of ``
with `<zws>`
escapeBold :: Text -> Text Source #
Replaces all occurences of **
with *<zws>*
escapeStrike :: Text -> Text Source #
Replaces all occurences of ~~
with ~<zws>~
escapeUnderline :: Text -> Text Source #
Replaces all occurences of __
with _<zws>_
escapeSpoilers :: Text -> Text Source #
Replaces all occurences of ||
with |<zws>|
escapeFormatting :: Text -> Text Source #
Escape all discord formatting
Formats some text into it's bolded form
Any existing bolded text is escaped
strike :: Text -> Text Source #
Formats some text into it's striked form
Any existing striked text is escaped
underline :: Text -> Text Source #
Formats some text into it's underlined form
Any existing underlined text is escaped
spoiler :: Text -> Text Source #
Formats some text into it's spoilered form
Any existing spoilers are escaped
displayUser :: (HasField' "username" a Text, HasField' "discriminator" a Text) => a -> Text Source #
class Mentionable a where Source #
Things that can be mentioned
Instances
Mentionable Channel Source # | |
Mentionable Category Source # | |
Mentionable Member Source # | |
Mentionable User Source # | |
Mentionable Role Source # | |
Mentionable DMChannel Source # | |
Mentionable VoiceChannel Source # | |
Defined in Calamity.Utils.Message mention :: VoiceChannel -> Text Source # | |
Mentionable TextChannel Source # | |
Defined in Calamity.Utils.Message mention :: TextChannel -> Text Source # | |
Mentionable GuildChannel Source # | |
Defined in Calamity.Utils.Message mention :: GuildChannel -> Text Source # | |
Mentionable (Snowflake Channel) Source # | |
Mentionable (Snowflake Category) Source # | |
Mentionable (Snowflake Member) Source # | |
Mentionable (Snowflake User) Source # | |
Mentionable (Snowflake Role) Source # | |
Mentionable (Snowflake DMChannel) Source # | |
Mentionable (Snowflake VoiceChannel) Source # | |
Defined in Calamity.Utils.Message | |
Mentionable (Snowflake TextChannel) Source # | |
Defined in Calamity.Utils.Message | |
Mentionable (Snowflake GuildChannel) Source # | |
Defined in Calamity.Utils.Message |