mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-28 16:02:49 -05:00
Fix color argument parsing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
|
import Color from 'color'
|
||||||
import ejs from 'ejs'
|
import ejs from 'ejs'
|
||||||
import { State } from 'xstate'
|
import { State } from 'xstate'
|
||||||
import { ChatClient, SlowModeRateLimiter, LoginError } from 'dank-twitch-irc'
|
import { ChatClient, SlowModeRateLimiter, LoginError } from 'dank-twitch-irc'
|
||||||
@@ -47,7 +47,7 @@ export default class TwitchBot extends EventEmitter {
|
|||||||
async onReady() {
|
async onReady() {
|
||||||
const { client } = this
|
const { client } = this
|
||||||
const { channel, color } = this.config
|
const { channel, color } = this.config
|
||||||
await client.setColor(color)
|
await client.setColor(Color(color).object())
|
||||||
await client.join(channel)
|
await client.join(channel)
|
||||||
this.emit('connected')
|
this.emit('connected')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import yargs from 'yargs'
|
import yargs from 'yargs'
|
||||||
import TOML from '@iarna/toml'
|
import TOML from '@iarna/toml'
|
||||||
import Color from 'color'
|
|
||||||
import { Repeater } from '@repeaterjs/repeater'
|
import { Repeater } from '@repeaterjs/repeater'
|
||||||
import { app, shell, session, BrowserWindow } from 'electron'
|
import { app, shell, session, BrowserWindow } from 'electron'
|
||||||
|
|
||||||
@@ -98,8 +97,7 @@ function parseArgs() {
|
|||||||
})
|
})
|
||||||
.option('twitch.color', {
|
.option('twitch.color', {
|
||||||
describe: 'Color of Twitch bot username',
|
describe: 'Color of Twitch bot username',
|
||||||
coerce: (text) => Color(text).object(),
|
default: '#ff0000',
|
||||||
default: { r: 255, g: 0, b: 0 },
|
|
||||||
})
|
})
|
||||||
.option('twitch.announce.template', {
|
.option('twitch.announce.template', {
|
||||||
describe: 'Message template for stream announcements',
|
describe: 'Message template for stream announcements',
|
||||||
|
|||||||
Reference in New Issue
Block a user