refactor(utils): add surround function
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from .common import LimitedSizeDict, filter_secrets, format_duration
|
||||
from .common import LimitedSizeDict, filter_secrets, format_duration, surround
|
||||
from .discord import (
|
||||
ChannelResponseWrapper,
|
||||
MessageInteractionWrapper,
|
||||
@@ -24,4 +24,5 @@ __all__ = [
|
||||
"MessageInteractionWrapper",
|
||||
"reply",
|
||||
"snowflake_timestamp",
|
||||
"surround",
|
||||
]
|
||||
|
@@ -3,6 +3,10 @@ from collections import OrderedDict
|
||||
from constants import SECRETS
|
||||
|
||||
|
||||
def surround(inner, outer="```"):
|
||||
return outer + str(inner) + outer
|
||||
|
||||
|
||||
def format_duration(duration: int, natural: bool = False, short: bool = False):
|
||||
def format_plural(noun, count):
|
||||
if short:
|
||||
|
Reference in New Issue
Block a user