mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 19:28:54 -05:00
Add quote() function to chat formatting utilities (#4425)
* add quote to chat_formatting * ... * jack's request
This commit is contained in:
parent
980b5fa1c2
commit
8a75d75d83
@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import itertools
|
||||
import textwrap
|
||||
from io import BytesIO
|
||||
from typing import Iterator, List, Optional, Sequence, SupportsInt, Union
|
||||
|
||||
@ -326,6 +327,23 @@ def underline(text: str, escape_formatting: bool = True) -> str:
|
||||
return "__{}__".format(text)
|
||||
|
||||
|
||||
def quote(text: str) -> str:
|
||||
"""Quotes the given text.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
text : str
|
||||
The text to be marked up.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
The marked up text.
|
||||
|
||||
"""
|
||||
return textwrap.indent(text, "> ", lambda l: True)
|
||||
|
||||
|
||||
def escape(text: str, *, mass_mentions: bool = False, formatting: bool = False) -> str:
|
||||
"""Get text with all mass mentions or markdown escaped.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user