44 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55/*global module.exports: false */
66var fs = require ( "fs" ) ;
7- module . exports . version = 0.9 ;
7+ module . exports . version = 0.91 ;
88module . exports . users = { } ;
99module . exports . DB_FILENAME = "todo.json" ;
1010
@@ -31,14 +31,14 @@ module.exports.cmd_todo = function cmd_todo(e) {
3131 if ( e . args ) {
3232 list . push ( e . args ) ;
3333 this . saveUsers ( ) ;
34- e . notice ( "Ok." ) ;
34+ // e.notice("Ok.");
3535 } else if ( ! list . length ) {
3636 e . reply ( "Nothing on your todo list." ) ;
3737 } else {
3838 var i = 0 ;
3939 e . reply ( list . map ( function addIndex ( todo ) {
4040 return "[{0}] {1}" . format ( i ++ , todo ) ;
41- } ) . join ( "; " ) ) ;
41+ } ) . join ( " " ) ) ;
4242 }
4343
4444 return true ;
@@ -67,24 +67,23 @@ module.exports.cmd_tododel = function cmd_tododel(e) {
6767 var deleted = indexes . length - notdeleted ;
6868 if ( deleted != 0 ) {
6969 this . saveUsers ( ) ;
70- e . notice ( "Ok, deleted {0} todo{1}." . format ( deleted , deleted == 1 ? "" : "s" ) ) ;
70+ // e.notice("Ok, deleted {0} todo{1}.".format(deleted, deleted == 1 ? "" : "s"));
7171 }
7272 if ( notdeleted > 0 )
73- e . reply ( "{0} todo{1}n't deleted. You only have {2} todo{3} on your todo list." . format (
74- notdeleted , notdeleted == 1 ? " was" : "s were" , list . length , list . length == 1 ? "" : "s" ) ) ;
73+ e . reply ( "You only have {0} todo{1}." . format ( list . length , list . length == 1 ? "" : "s" ) ) ;
7574 } else {
7675 var filteredlist = list . filter ( function startsWith ( s ) {
7776 return s . slice ( 0 , e . args . length ) == e . args ;
7877 } ) ;
7978
8079 switch ( filteredlist . length ) {
8180 case 0 :
82- e . reply ( "No todos found starting with \"{0}\"." . format ( e . args ) ) ;
81+ e . reply ( "No todos starting with \"{0}\"." . format ( e . args ) ) ;
8382 break ;
8483 case 1 :
8584 list . splice ( list . indexOf ( filteredlist [ 0 ] ) , 1 ) ;
8685 this . saveUsers ( ) ;
87- e . notice ( "Ok, deleted \"{0}\"." . format ( filteredlist [ 0 ] ) ) ;
86+ // e.notice("Ok, deleted \"{0}\".".format(filteredlist[0]));
8887 break ;
8988 default :
9089 var formattedlist = [ ] , currentindex = 0 ;
@@ -113,11 +112,11 @@ module.exports.cmd_todoins = function cmd_todoins(e) {
113112 var index = Number ( match [ 1 ] ) , todo = match [ 2 ] ;
114113
115114 if ( index >= list . length )
116- e . reply ( "You only have {0} todo{1} on your todo list ." . format ( list . length , list . length == 1 ? "" : "s" ) ) ;
115+ e . reply ( "You only have {0} todo{1}." . format ( list . length , list . length == 1 ? "" : "s" ) ) ;
117116 else {
118117 list . splice ( index , 0 , todo ) ;
119118 this . saveUsers ( ) ;
120- e . notice ( "Ok." ) ;
119+ // e.notice("Ok.");
121120 }
122121 return true ;
123122}
0 commit comments