-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix double post on modded servers #142
base: master
Are you sure you want to change the base?
Fix double post on modded servers #142
Conversation
Added function to filter double Messages
Hello! I appreciate your work and your time writing this PR. I do have one concern with this for vanilla servers - take a conversation like the following:
However unlikely, I can see there being some scenarios where this would trigger and cause confusion. Users not familiar with this fix would probably have no idea why their message didn't go through. That is if they notice at all, leading to a confusing, maybe even frustrating conversation. I'd accept these changes behind a config option so that modded servers can turn it on only if they need to. If you'd like, I'm willing to make this change for you before merging. This would happen sometime within the next week or two. Or if you'd prefer, make this change on your end - then all that's required on my end is a quick test & merge. If I push a change to this PR, it will show up here in your fork. Let me know what you'd like to do. |
Hey Lake, |
Add regex example for ServerTools mod (WIP).
@LakeYS hey there, i have pushed another commit, please take a look and tell me what you think. |
Hi, thanks for the updates! Couple notes on the config option: I think naming it A few code nitpicks: I think the The extra console.log's should probably be removed unless they're really necessary for server hosts to see. For the part handling duplicate messages here, I'd like to see this moved beneath this part where hide-prefix is handled. The sanitizeMsgFromGame function is meant to only handle removing abuse-able strings from messages. Plus this way you can use the return statement (just like hide-prefix does) instead of needing to pass in an empty string to suppress the message. Basically make your duplicate message removal work consistently with hide-prefix. |
This is a potential fix for the issue mentioned in
#141
and
#138
where on a modded server messages that are sent appear twice on the Discord channel. I added a storage variable and a function to check for the doubled message.
To not end up in a loop, the storage Variable will be cleared after it was detected it is a duplicate.
This has one downside though: on a non-modded server if someone posts the same message twice, the second message would not be sent to the Discord channel (the third time will work again, fourth not, ... and so on). But i don't think the impact is too negative. I don't know enough about the message system of 7days to counter that.
It was tested and confirmed working by the User DarqRain on the 7daystodie discord server.
Thank you LakeYS for the easy to read code and the good comments :)