Skip to content

Instantly share code, notes, and snippets.

@prawnsalad
Last active December 22, 2019 16:49
Show Gist options
  • Save prawnsalad/c1d3a35c51aef45644a6daa7fd0ca044 to your computer and use it in GitHub Desktop.
Save prawnsalad/c1d3a35c51aef45644a6daa7fd0ca044 to your computer and use it in GitHub Desktop.

Revisions

  1. prawnsalad revised this gist Dec 22, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion nobnc.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    kiwi.on('irc.message', (message, network, event) => {
    kiwi.plugin('myplugin', function(kiwi) {
    kiwi.on('irc.message', function(message, network, event) {
    if (message.nick === '*bnc' && message.message) {
    // Only show *bnc messages if we have the buffer open.
    // We don't want confusing messages to users
    @@ -8,3 +9,4 @@
    }
    }
    });
    });
  2. prawnsalad created this gist Dec 22, 2019.
    10 changes: 10 additions & 0 deletions nobnc.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    kiwi.on('irc.message', (message, network, event) => {
    if (message.nick === '*bnc' && message.message) {
    // Only show *bnc messages if we have the buffer open.
    // We don't want confusing messages to users
    let buffer = network.bufferByName('*bnc');
    if (!buffer) {
    event.handled = true;
    }
    }
    });