From 9358be43fc7b27aa62245581202d75f5967fe5f6 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 5 Dec 2020 12:01:48 +0200 Subject: [PATCH] format fixes --- irc/format.ts | 5 ++++- irc/plugin.ts | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/irc/format.ts b/irc/format.ts index 47398fa..97c6842 100644 --- a/irc/format.ts +++ b/irc/format.ts @@ -4,11 +4,14 @@ import { approximateB16Color, Formatter } from '@squeebot/core/lib/types'; export class IRCFormatter extends Formatter { public formatting = { bold: {start: '\u0002', end: '\u000F'}, - italic: {start: '\u0016', end: '\u000F'}, + italics: {start: '\u0016', end: '\u000F'}, emphasis: {start: '\u0016', end: '\u000F'}, underline: {start: '\u001F', end: '\u000F'}, + action: {start: '\x01ACTION ', end: '\x01'}, }; + public colorEscape = '\u000F'; + public colors: {[key: string]: string} = { black: '\u00031', darkblue: '\u00032', diff --git a/irc/plugin.ts b/irc/plugin.ts index 610a7c4..6a2c0cb 100644 --- a/irc/plugin.ts +++ b/irc/plugin.ts @@ -40,10 +40,18 @@ class IRCMessage implements IMessage { return this.source.fullName + '/' + this.target.id; } + public get text(): string { + return this.data; + } + public resolve(...args: any[]): void { this.resolved = true; this.source.resolve(this, ...args); } + + public mention(user: IMessageTarget): string { + return user.name; + } } class IRCProtocol extends Protocol { @@ -56,6 +64,7 @@ class IRCProtocol extends Protocol { public start(...args: any[]): void { this.runEvents(); + this.me.id = this.me.name = this.irc.options.nick; this.irc.connect(); this.running = true; @@ -112,6 +121,7 @@ class IRCProtocol extends Protocol { this.irc.on('authenticated', () => { logger.log('[%s] Instance started successfully.', this.fullName); + this.me.id = this.me.name = this.irc.options.nick; }); this.irc.on('error', (errdat) => {