refactor(utils): add surround function

This commit is contained in:
2025-02-25 17:55:07 -05:00
parent 0a8482c030
commit 5430f7c632
3 changed files with 21 additions and 18 deletions

View File

@@ -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",
]

View File

@@ -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: