Skip to content
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

Bot doesn't like Russian characters - throws TypeError #171

Open
DSSoftware opened this issue Jul 9, 2023 · 4 comments
Open

Bot doesn't like Russian characters - throws TypeError #171

DSSoftware opened this issue Jul 9, 2023 · 4 comments

Comments

@DSSoftware
Copy link

How to reproduce:

Message like абв causes the bot to throw TypeError:

TypeError: Cannot read properties of null (reading '0')
    at Filter.clean (/home/node/bridge/node_modules/bad-words/lib/badwords.js:58:41)
    at MinecraftManager.onBroadcast (/home/node/bridge/src/minecraft/MinecraftManager.js:98:26)
    at DiscordManager.broadcastMessage (/home/node/bridge/src/contracts/CommunicationBridge.js:15:24)
    at MessageHandler.onMessage (/home/node/bridge/src/discord/handlers/MessageHandler.js:33:18)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Needs more testing, as I'm running the #169 version of the bot, but I doubt the fix broke filter

@DuckySoLucky
Copy link
Owner

Seems like issue with bad-words package, I have been really busy for past few weeks and will be for like 2 weeks more. So sorry won't be able to make fix or check that out ;-;

@DSSoftware
Copy link
Author

Well, don't think that's critical. I'll look into it after, but I doubt there's a lot of Russian users with this bot lol.
The only critical-ish thing is that it crashes for me.

But idk i literally rewrote the entire startup sequence so it starts in a cluster, so that might be the issue with crashing.

@DSSoftware
Copy link
Author

Also, is it ok to continue after getting uncaughtException?

The correct use of 'uncaughtException' is to perform synchronous cleanup of allocated resources (e.g. file descriptors, handles, etc) before shutting down the process. It is not safe to resume normal operation after 'uncaughtException'.

https://github.com/DuckySoLucky/hypixel-discord-chat-bridge/blob/4ec232b06df3f71da8b2d1ef360f1459f6b73ba2/index.js#L1C1-L1C64

@Kathund
Copy link
Contributor

Kathund commented Aug 9, 2024

Seems like issue with bad-words package, I have been really busy for past few weeks and will be for like 2 weeks more. So sorry won't be able to make fix or check that out ;-;

Ducky is right on this. We can't do much about this. There's and issue already opened on the packages repo. #174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants