calamity-0.1.14.3: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Utils.Message

Description

Things for formatting things

Synopsis

Documentation

codeblock Source #

Arguments

:: Text

language

-> Text

content

-> Text 

Formats a lang and content into a codeblock

>>> codeblock "hs" "x = y"
"```hs\nx = y\n```"

Any codeblocks in the content are escaped

codeblock' Source #

Arguments

:: Maybe Text

language

-> Text

content

-> Text 

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

bold :: Text -> Text Source #

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

quote :: Text -> Text Source #

Quotes a section of text

quoteAll :: Text -> Text Source #

Quotes all remaining text

spoiler :: Text -> Text Source #

Formats some text into it's spoilered form

Any existing spoilers are escaped

zws :: IsString s => s Source #

displayUser :: (HasField' "username" a Text, HasField' "discriminator" a Text) => a -> Text Source #

Format a User or Member into the format of username#discriminator

class Mentionable a where Source #

Things that can be mentioned

Methods

mention :: a -> Text Source #

Instances

Instances details
Mentionable Channel Source # 
Instance details

Defined in Calamity.Utils.Message

Methods

mention :: Channel -> Text Source #

Mentionable Category Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable Member Source # 
Instance details

Defined in Calamity.Utils.Message

Methods

mention :: Member -> Text Source #

Mentionable User Source # 
Instance details

Defined in Calamity.Utils.Message

Methods

mention :: User -> Text Source #

Mentionable Role Source # 
Instance details

Defined in Calamity.Utils.Message

Methods

mention :: Role -> Text Source #

Mentionable DMChannel Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable VoiceChannel Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable TextChannel Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable GuildChannel Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Channel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Category) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Member) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake User) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Role) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake DMChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake VoiceChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake TextChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake GuildChannel) Source # 
Instance details

Defined in Calamity.Utils.Message