mirror of
https://github.com/FranP-code/shopping-discord-bot.git
synced 2025-10-13 00:22:44 +00:00
refactoring and adding limit command option
This commit is contained in:
5
scripts/truncateText.js
Normal file
5
scripts/truncateText.js
Normal file
@@ -0,0 +1,5 @@
|
||||
function truncateText(text, max) {
|
||||
return text.substr(0, max - 1).trim() + (text.length > max ? '...' : '');
|
||||
}
|
||||
|
||||
module.exports = truncateText;
|
||||
Reference in New Issue
Block a user