Skip to content

Commit

Permalink
Fixed sending ascii to overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruiser8 authored Mar 7, 2020
1 parent 9303ebf commit 1b10a36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TTSAlertsAndChat_StreamlabsSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

""" Text-To-Speech for Alerts and Chat Messages
1.1.2
Support ascii characters in overlay
1.1.1
Control overlay position/message, ban users, and set a character limit
Expand Down Expand Up @@ -300,7 +303,7 @@ def handleEvent(sender, args):
SendTTSMessagesWithDelay(ttsMessage, ScriptSettings.TwitchSubDelay, ScriptSettings.TwitchIncludeSubMessage, message.Message, message.Name)

except Exception as e:
Parent.SendStreamWhisper(Parent.GetChannelName(), 'TTS Failed, please see logs')
Parent.SendStreamWhisper(Parent.GetChannelName(), 'Failed to process subscription. Please see logs (i).')
Parent.Log(ScriptName, str(e.args))

elif evntdata and evntdata.For == "mixer_account":
Expand Down Expand Up @@ -389,6 +392,7 @@ def updateBannedSettings():

def SendOverlayUpdate(message):
""" Send updated information to the overlay. """
message = message.encode('utf8', 'replace')
payload = {
'message': message,
'time': ScriptSettings.TTSOverlayTime,
Expand Down Expand Up @@ -426,6 +430,7 @@ def SendTTSMessage(voice, message, isAlert, user = '', text = '', displayName =
return
else:
message = reBanned.sub(ScriptSettings.BannedReplacement, message)

try:
if (isAlert and not ScriptSettings.TTSOverlayExcludeAlerts) or (not isAlert and not user):
SendOverlayUpdate(message)
Expand All @@ -434,7 +439,7 @@ def SendTTSMessage(voice, message, isAlert, user = '', text = '', displayName =

voice.Speak(message)
except Exception as e:
Parent.SendStreamWhisper(Parent.GetChannelName(), 'TTS Failed, please see logs')
Parent.SendStreamWhisper(Parent.GetChannelName(), 'TTS Failed, please see the script logs (i).')
Parent.Log(ScriptName, str(e.args))

def SendTTSMessagesWithDelay(message, delay, includeExtra = False, extraMessage = '', user = ''):
Expand Down

2 comments on commit 1b10a36

@TOWUK
Copy link

@TOWUK TOWUK commented on 1b10a36 Mar 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, update please banned users (with timers) example: !banuser towuk118 60 // ban user say message from 60 second :3

@Kruiser8
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, update please banned users (with timers) example: !banuser towuk118 60 // ban user say message from 60 second :3

I'll add that to the list for the next release. Thanks for the suggestion!

Please sign in to comment.