fjaros / wowchat

WoWChat is a clientless Discord integration chat bot for old versions of World of Warcraft.
GNU General Public License v3.0
139 stars 96 forks source link

Achievement issue #120

Closed Bennylavaa closed 4 months ago

Bennylavaa commented 4 months ago

Getting a parsing error or something in Discord with achievements when someone earns one

Totembringer has earned the achievement [5012]!

However when they link that same achievement in chat it looks like this:

[Totembringer]: [Broodmother's Lair]

I understand this is a custom quest and I have added it to the achivements.csv here https://github.com/Bennylavaa/wowchat-epoch/blob/main/src/main/resources/achievements.csv

This is my config as well achievement { enabled=1 format="%user has earned the achievement %achievement!"

I have this repo going because its a custom server.

It seems to only affect the messages put in guild chat when you unlock the achievement.

Any ideas?

fjaros commented 4 months ago

Did you recompile the project and start it again with the new jar?

Bennylavaa commented 4 months ago

Yes I did

On Tue, Apr 23, 2024, 8:12 PM Filip Jaroš @.***> wrote:

Did you recompile the project and start it again with the new jar?

— Reply to this email directly, view it on GitHub https://github.com/fjaros/wowchat/issues/120#issuecomment-2073690356, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHLVAJPYZSQLCPGB234A3IDY632FVAVCNFSM6AAAAABGJUQDECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTGY4TAMZVGY . You are receiving this because you authored the thread.Message ID: @.***>

fjaros commented 4 months ago

Can you upload your compiled jar here or give me a link?

Bennylavaa commented 4 months ago

https://github.com/Bennylavaa/wowchat-epoch/releases/tag/1.03

should be here

Bennylavaa commented 4 months ago

wowchat.zip

Bennylavaa commented 4 months ago

What I am not understanding if linked the achievement text is put into chat. However, the guild announcement sends an id instead of the achievement text.

fjaros commented 4 months ago

yeah it's because linking in the chat actually sends the achievement name in the message itself so wowchat parses that from the message and displays it. in the case of guild notification, we only get the ID hence why we need a text file to look up the name of that ID. https://github.com/fjaros/wowchat/blob/master/src/main/scala/wowchat/discord/MessageResolver.scala#L43

As you see, the fallback if the ID is not found is to just return the ID as the name. So it looks like the lookup is failing. But it seems that your achievements.csv is correct and also you recompiled it into the jar so the lookup should be succeeding.

So I don't know what's up. You'll need to debug the content of the GameResources.ACHIEVEMENT map.

Bennylavaa commented 4 months ago

alright, I also just noticed that the chatbot doesnt log the guild announcement achievement in its log, it just logs the linked ones.

Bennylavaa commented 4 months ago

actually this might break it

247,Make Love, Not Warcraft

Bennylavaa commented 4 months ago

would make sense why some work and others dont, could be that everything below that gets wonked out.

Bennylavaa commented 4 months ago

there are a few achievements with commas in their names.

fjaros commented 4 months ago

That's okay and expected: https://github.com/fjaros/wowchat/blob/master/src/main/scala/wowchat/game/GameResources.scala#L16