File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Repete uma mensagem em um determinado período de tempo. Cada mensagem é repres
1313 \`\`\`--stop\`\`\` -> _para uma thread._
1414 \`\`\`--start\`\`\` -> _inicia uma thread._
1515 \`\`\`--log\`\`\` -> _mostra as threads existentes._
16+ \`\`\`--killall\`\`\` -> _para e apaga todas as threads._
1617 \`\`\`--help\`\`\` -> _mostra esta mensagem._
1718
1819*kwargs válidos:*
@@ -124,6 +125,14 @@ class Cron {
124125 return output . trim ( ) ;
125126 }
126127
128+ killall ( ) {
129+ this . threads . forEach ( ( t ) => {
130+ this . destroy ( t . id ) ;
131+ } ) ;
132+
133+ return 'Todas as threads foram destruidas.' ;
134+ }
135+
127136 runs ( data , message ) {
128137 const methods = {
129138 log : ( ) => this . log ( ) ,
@@ -132,6 +141,7 @@ class Cron {
132141 start : ( ) => this . start ( data . text ) ,
133142 stop : ( ) => this . stop ( data . text ) ,
134143 help : ( ) => this . strings . help ,
144+ killall : ( ) => this . killall ( ) ,
135145 } ;
136146
137147 if ( methods [ data . args [ 0 ] ] ) {
You can’t perform that action at this time.
0 commit comments