discord-styled-text 1.0.0

Creator: bradpython12

Last updated:

Add to Cart

Description:

discordstyledtext 1.0.0

discord-styled-text
A small library to style text for Discord without having to remember any syntax

Installation
discord-styled-text requires Python 3.6 at minimum.
$ pip install discord-styled-text

Documentation
Documentation is available on ReadTheDocs.
Example Usage
>>> from discord_styler import *

>>> bold_text = Bold("Here's some bold text")
>>> italic_text = Italic("and here's some", Underline("italic text"), "with nested styles!")
>>> text = StyledText("We can combine them:", bold_text, italic_text)
>>> str(text)
"We can combine them: **Here's some bold text** *and here's some __italic text__ with nested styles!*"

>>> quoted = StyledText(BlockQuote(text), "and we can do quotes too")
>>> str(quoted)
"> We can combine them: **Here's some bold text** *and here's some __italic text__ with nested styles!*\n and we can do quotes too"

>>> question = StyledText(
... UserMention(200102491231092736),
... f"will you be free at {TimeStamp(1618953630, TimeStyle.LongDateTime)}?",
... f"I'll be doing code review in {ChannelMention(656893570711814145)} if you wanna join")
>>> str(question)
"<@200102491231092736> will you be free at <t:1618953630:F>? I'll be doing code review in <#656893570711814145> if you wanna join"

>>> link = NonEmbeddingURL("https://github.com/miaowware/discord-styled-text/pull/1")
>>> str(link)
'<https://github.com/miaowware/discord-styled-text/pull/1>'

>>> code = StyledText(
... "What do you think of this?\n",
... CodeBlock('def __str__(self) -> str:\n return "||" + super().__str__() + "||"', lang="py"))
>>> str(code)
'What do you think of this?\n ```py\ndef __str__(self) -> str:\n return "||" + super().__str__() + "||"\n```'


Copyright
Copyright 2021 classabbyamp, 0x5c
Released under the BSD 3-Clause License.
See LICENSE for the full license text.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.