Fixes re: zognia's testing #2
1 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,8 @@ class TwitchProcess(ChatProcess):
|
||||||
botname=None, emote_res=4.0,
|
botname=None, emote_res=4.0,
|
||||||
# EventSub options
|
# EventSub options
|
||||||
eventsub=True, eventsub_host='wss://ovtk.skeh.site/twitch',
|
eventsub=True, eventsub_host='wss://ovtk.skeh.site/twitch',
|
||||||
|
# BTTV integration
|
||||||
|
bttv=False,
|
||||||
# Inheritance boilerplate
|
# Inheritance boilerplate
|
||||||
**kwargs):
|
**kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
@ -61,7 +63,7 @@ class TwitchProcess(ChatProcess):
|
||||||
self.eventsub = TwitchEventSub(self.api, eventsub_host)
|
self.eventsub = TwitchEventSub(self.api, eventsub_host)
|
||||||
self._sources.append(self.eventsub)
|
self._sources.append(self.eventsub)
|
||||||
|
|
||||||
self.bttv = BTTV(target_data['user']['id'])
|
self.bttv = BTTV(target_data['user']['id']) if bttv else None
|
||||||
|
|
||||||
|
|
||||||
def loop(self, next_state):
|
def loop(self, next_state):
|
||||||
|
@ -98,7 +100,7 @@ class TwitchProcess(ChatProcess):
|
||||||
for event in chain(*(source.read(0.1) for source in self._sources)):
|
for event in chain(*(source.read(0.1) for source in self._sources)):
|
||||||
# Retarget event
|
# Retarget event
|
||||||
event.via = self._name
|
event.via = self._name
|
||||||
if isinstance(event, Message):
|
if self.bttv and isinstance(event, Message):
|
||||||
event = self.bttv.hydrate(event)
|
event = self.bttv.hydrate(event)
|
||||||
self.publish(event)
|
self.publish(event)
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue