stream-chat icon indicating copy to clipboard operation
stream-chat copied to clipboard

block certain words or phrases from populating in stream chat

Open wiremajik opened this issue 1 year ago • 1 comments

as discussed in discord this would be very helpful as I would rather not just block the words on twitch end. Streamer bot would auto ban anyone using certain words, which works, and I would like if chat stream does not show it as well

wiremajik avatar Aug 04 '24 18:08 wiremajik

I've found a solution on my end, though I don't know how to make pull requests. The app does seem to remove messages from banned chatters, just Streamer Bot may have changed message data.

If you backup your file called Chat.html and attempt these edits, let me know how it goes! I open it with notepad++ and that shows me a line counter on the left side, which is crucial for my advice.

Line 1274 says remove_messages_by_user_id(wsdata.data.userId); and this needs to be changed to remove_messages_by_user_id(wsdata.data.user_id);

For another bug, line 1277 right below, remove_messages_by_message_id(wsdata.data.targetMessageId); needs the final part to be changed. remove_messages_by_message_id(wsdata.data.messageId);

lastly, the new user_id appears to be a string, so you have to go to line 1054. the existing code is
if (parseInt(messages[i].dataset.userId) === user_id) { and the update code I have for you is to also parse the Int for the second half. the update code should be if (parseInt(messages[i].dataset.userId) === parseInt(user_id)) {

unlightednetting avatar Jan 01 '25 20:01 unlightednetting