TheCraiggers / Pathfinder-Discord-Bot

MIT License
24 stars 15 forks source link

Names not found in all commands #54

Open TarEcthelion opened 4 years ago

TarEcthelion commented 4 years ago

Currently there appears to be a bug parsing/addressing some names (ones with spaces it seems) in some commands (Damage and Remove for example)

Duplication !omni add enemy 'War Boss' AC:40 HP:300/300 Init:{1d20+10} !damage 'War Boss' 5 !omni remove enemy 'War Boss'

TheCraiggers commented 4 years ago

Well crap. That does indeed look to be a bug. Is this currently affecting your game, or was this just during testing?

TarEcthelion commented 4 years ago

Testing; I was learning what it was capable of and playing with the examples.

Your choice to use a dedicated data channel works to my advantage here though, I was able to remove the data manually there. And as long as I keep the name(s) simple it's ok. I've never been a big JS guy, and I've never played with "promises" but I started looking... ;-) Just haven't found the cause yet.

Great work overall though... super impressed. Looking forward to seeing it live and grow, happy to help.

TheCraiggers commented 4 years ago

Hah, I've never been a big JS guy either. And promises were alien to me before I started this project. In fact, I started this in order to learn modern JS. Mostly what I've learned is that I kinda dislike it. Another contributor is working on migrating the codebase to TypeScript though, which might help some of my annoyances, so I'm trying to withhold judgement until then. =)

mirkoRainer commented 4 years ago

https://blog.bitsrc.io/keep-your-promises-in-typescript-using-async-await-7bdc57041308

Who needs promises anyway? ;)