simple-helix-api
Advanced tools
Comparing version 3.3.0-beta.8 to 3.3.0-beta.9
@@ -146,3 +146,3 @@ "use strict"; | ||
} | ||
say(text, channel = this.channels[0]) { | ||
say(text, channel = this.channels[0], tags) { | ||
if (!this.connected || !text) { | ||
@@ -155,3 +155,9 @@ return false; | ||
text = text.substring(0, 500); | ||
this.connection.send(`PRIVMSG ${channel} :${text}`); | ||
let command = `PRIVMSG ${channel} :${text}`; | ||
if (tags) { | ||
command = Object.keys(tags).map(key => { | ||
return `@${key}=${tags[key]}`; | ||
}) + " " + command; | ||
} | ||
this.connection.send(command.trim()); | ||
this.events.emit("message", { | ||
@@ -158,0 +164,0 @@ ...this.globalUserState, |
{ | ||
"name": "simple-helix-api", | ||
"version": "3.3.0-beta.8", | ||
"version": "3.3.0-beta.9", | ||
"description": "The Simple Helix API allows developers to easily develop applications for Twitch", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -22,3 +22,3 @@ /// <reference types="node" /> | ||
onMessage(parsed: IRCMessage): boolean | undefined; | ||
say(text: string, channel?: string | string[]): boolean; | ||
say(text: string, channel?: string | string[], tags?: Record<string, string>): boolean; | ||
command(command: string, args?: string | string[], channel?: string | string[]): boolean; | ||
@@ -25,0 +25,0 @@ on(event: TChatEvent, listener: (...args: any) => any): EventEmitter; |
97873
2231