worky
This commit is contained in:
12
utils.py
Normal file
12
utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import datetime
|
||||
from config import Config
|
||||
|
||||
def truncate(text: str, limit: int = Config.EMBED_LIMIT) -> str:
|
||||
"""Truncates text to ensure it fits in an Embed field."""
|
||||
if len(text) > limit:
|
||||
return text[:limit] + "..."
|
||||
return text
|
||||
|
||||
def get_timestamp():
|
||||
"""Returns the current timestamp."""
|
||||
return datetime.datetime.now()
|
||||
Reference in New Issue
Block a user