Skip to content

Commit

Permalink
Add clearall command
Browse files Browse the repository at this point in the history
  • Loading branch information
rahatarmanahmed committed Jun 21, 2016
1 parent 206557d commit 29797e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/commands/clearall.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = (args, { client, server }) => {
client.clear();
client.channels().forEach(chan => client.clear(chan));
Object.keys(server.userMessages).forEach(user => client.clear(user));
};
2 changes: 2 additions & 0 deletions app/scripts/core/corePackage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const msg = require('../commands/msg');
const join = require('../commands/join');
const part = require('../commands/part');
const clear = require('../commands/clear');
const clearall = require('../commands/clearall');
const mode = require('../commands/mode');
const op = require('../commands/op');
const deop = require('../commands/deop');
Expand All @@ -32,6 +33,7 @@ const CoreCommandPackage = (Squelch) => {
this.subscriptions.add(Squelch.commands.register('leave', part));
this.subscriptions.add(Squelch.commands.register('close', part));
this.subscriptions.add(Squelch.commands.register('clear', clear));
this.subscriptions.add(Squelch.commands.register('clearall', clearall));
this.subscriptions.add(Squelch.commands.register('mode', mode));
this.subscriptions.add(Squelch.commands.register('op', op));
this.subscriptions.add(Squelch.commands.register('deop', deop));
Expand Down

0 comments on commit 29797e9

Please sign in to comment.