destruc7i0n / shulker

A Discord to Vanilla Minecraft Chat Gateway
ISC License
135 stars 47 forks source link

@ and maybe other symbol escaping? #9

Closed Keaft closed 4 years ago

Keaft commented 8 years ago

I tried to get my attention from minecraft in discord with "@keaft" like a pleb and,

http://pastebin.com/ZGzdp0An

Could be a function of the differing regex I'm using?

It crashes and closes shulker.

s-thom commented 8 years ago

That looks like an issue with discord.js. That stacktrace isn't giving me a lot to go on past that.


As a side note, Discord doesn't actually send @username, instead it sends <@userid> (and <#channelid> for channel mentions). It's the clients that then translate that and make it look like a user mention. You can see this if you do an @mention in Discord and see what happens in Minecraft.

If you want to @mention from Minecraft, you'll need a 'translator' that takes the @username and turns it into <@userid>

Keaft commented 8 years ago

Turns out this also occurs when someone edits a message in discord. I was running it under forever, and yet it still hangs for some reason on occasion. Currently running it under forever appears to assuage the issue, but I thought I would let you know anyway.

http://pastebin.com/avK0pcie

Keaft commented 8 years ago

So even forever doesn't seem to keep this up forever anymore.

http://pastebin.com/WsmRwxHk

I'm running: forever -e ./error.log start index.js to capture the error log. You can see it manages to pull it back up from the same error over and over again, but for some reason unknown to me it eventually fails.

destruc7i0n commented 8 years ago

What are you doing on Discord throughout all these errors?

Keaft commented 8 years ago

So as far as replicatable behaviors: I can trigger the error everytime if I edit a message in discord after I post it. It appears I can also trigger it if I post a youtube link inside of minecraft. and if I try to mention in minecraft (@keaft).

Other behaviors, which don't seem to effect it, include just straight up chatting on mc and discord and posting web links on discord.

Otherwise it seems to just happen over time. Do you know of a way to add timestamps to the forever error log file?

Edit so I just checked the tail -f that reads out to your bot and I see: Cannot POST /minecraft/hook Over and over and over again. I feel like this suggests I have it set up wrong? tail -F ./Minecraft/logs/latest.log | grep --line-buffered ": <" | while read x ; do echo -ne $x | curl -X POST -d @- http://127.0.0.1:8000/minecraft/hook ; done

destruc7i0n commented 8 years ago

That seems to be the way the tail is supposed to work... I cannot seem to replicate this error myself :/

Keaft commented 8 years ago

Is there a way I can get a more verbose error log. Maybe something that lists everything that is going on?

destruc7i0n commented 8 years ago

You can try enabling Debug in the config file.