File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Utils related to commands.
3+ */
4+ class Command {
5+ /**
6+ * Tag to format a string to be sended as a message.
7+ * @param {string[] } strings
8+ * @param {...any } values
9+ * @returns {string } - formatted string
10+ */
11+ static message ( strings , ...values ) {
12+ const STR = strings . map ( ( s , i ) =>
13+ i + 1 === strings . length ? s : s + values [ i ]
14+ ) ;
15+
16+ return STR . join ( '' )
17+ . split ( '\n' )
18+ . map ( ( s ) => s . trim ( ) )
19+ . join ( '\n' )
20+ . trim ( ) ;
21+ }
22+ }
23+
24+ module . exports = Command ;
Original file line number Diff line number Diff line change 33module . exports = {
44 Parse : require ( './Parse' ) ,
55 chattools : require ( './chattools' ) ,
6+ Command : require ( './Command' ) ,
67 search : require ( './search' ) ,
78 Time : require ( './time' ) ,
89} ;
You can’t perform that action at this time.
0 commit comments