From e0b38cb708ec9e252963ceb44720b6f35a27f141 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 24 Sep 2022 12:21:31 +0300 Subject: [PATCH] ctcp wrapper function example --- src/examples/connection-test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/examples/connection-test.ts b/src/examples/connection-test.ts index 6c51e2d..588e217 100644 --- a/src/examples/connection-test.ts +++ b/src/examples/connection-test.ts @@ -1,5 +1,6 @@ import { IRCBot } from '../bot'; import { + applyCTCP, applyTextColor, wrapFormattedText, } from '../utility/message-formatting'; @@ -65,6 +66,11 @@ bot.on('message', ({ message, to, nickname }) => { return; } + if (message.startsWith('!hug')) { + bot.send(to, applyCTCP(`hugs ${nickname}`)); + return; + } + if (message.startsWith('!names')) { bot.names(to).then(console.log); return;