Skip to content

Instantly share code, notes, and snippets.

<script>
kiwi.plugin('user-colour', function(kiwi, log) {
var nextRender = false;
// listen for first message to render
// this changes colour at startup
listenRender();
kiwi.on('active.component', function() {
// When returning from other components like settings
// listen for first message to render
# clone repos
git clone https://github.com/kiwiirc/kiwiirc.git ~/kiwiirc/kiwiirc
git clone https://github.com/kiwiirc/webircgateway.git ~/kiwiirc/webircgateway
git clone https://github.com/kiwiirc/plugin-fileuploader.git ~/kiwiirc/plugin-fileuploader
# make destination directories
mkdir -p ~/kiwiirc/run/plugins
mkdir -p ~/kiwiirc/run/www
# setup fileupload as plugin
[Unit]
Description=KiwiIRC plugin fileuploader
After=network.target
[Service]
User=kiwiirc
Group=kiwiirc
ExecStart=/usr/bin/kiwiirc-fileuploader --config=/etc/kiwiirc/plugin-fileuploader.toml
ExecReload=/bin/kill -HUP $MAINPID
WorkingDirectory=/usr/local/kiwiirc/
[Unit]
Description=Kiwi IRC webircgateway
After=network.target
[Service]
User=kiwiirc
Group=kiwiirc
ExecStart=/usr/bin/webircgateway --config=/etc/kiwiirc/config.conf
ExecReload=/usr/bin/kill -HUP $MAINPID
WorkingDirectory=/usr/local/kiwiirc/

reCaptcha / hCpatcha

Kiwi IRC can support either reCaptcha or hCaptcha and can always ask for verification or based on dnsbl response

reCaptcha

To enable reCaptcha support a site key and secret is required from google. These can be obtained here

config.conf

note: if required = false then [dnsbl] section applies

[verify]
recaptcha_secret = "SECRET KEY HERE"
<style>
.kiwi-nicklist-user-prefix {
display: none;
}
.kiwi-nicklist-user--mode-o .kiwi-nicklist-user-nick::before {
content: "\f222";
font-family: fontAwesome;
}
<script>
kiwi.plugin('customise', function(kiwi, log) {
kiwi.on('irc.message', (message, network, event) => {
if (message.type === 'notice' && message.from_server === true) {
message.from_server = false;
}
});
});
</script>
yarn run v1.22.4
$ vue-cli-service test:unit
PASS tests/unit/MessageParser.spec.js (7.09s)
PASS tests/unit/Misc.spec.js (7.079s)
PASS tests/unit/StartupError.spec.js
FAIL tests/unit/BatchAdd.spec.js (13.875s)
● batchedAdd.vue › should process 102 single items, then a batch of 3
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
<script>
kiwi.plugin('ctcp_version', function(kiwi, log) {
kiwi.on('irc.ctcp request', function(event, network, ircEventObj) {
if (event.type !== 'VERSION') {
return;
}
// This adds a message to the server buffer for the request
let TextFormatting = kiwi.require('helpers/TextFormatting');
let serverTime = (event && event.time) || 0;
<script>
kiwi.plugin('fa5', function(kiwi, log) {
let fa5all = document.createElement('script');
fa5all.src = 'https://use.fontawesome.com/releases/v5.15.2/js/all.js';
document.head.append(fa5all);
let fa5shim = document.createElement('script');
fa5shim.src = 'https://use.fontawesome.com/releases/v5.15.2/js/v4-shims.js';
document.head.append(fa5shim);
});