Galarzaa90 / NabBot

Discord bot for Tibia servers
https://nabbot.xyz
Apache License 2.0
52 stars 25 forks source link

Enhance /monster to add information about walks around/through #132

Closed Tschis closed 5 years ago

Tschis commented 5 years ago

Enhance /monster to add information about what elements the monster walks around or through.

This change needs to be deployed together with new version of the database, as tibiawiki-sql has also been updated to change the schema and parse those fields.

Tschis commented 5 years ago

This closes issue #110.

Galarzaa90 commented 5 years ago

Thanks!

Before merging the following must be done:

Galarzaa90 commented 5 years ago

Ok, I updated the database now and tested, but there's still a issue.

config.py checks for missing keys and gets the default value if the key is not found.

The problem is that for elements, they are subkeys, and this new "element" that was added, poison, is not checked, so everyone that updates to this, won't get a warning that a key is missing in their config and the command will fail for them. image

So, either something must be changed in config.py, or in tibiawiki.py.

For instance, dictionaries have a get() method that lets you get the value in a certain key, or None if the key is not found, instead of throwing a KeyError exception., Aditionally, the second parameter can be used to specify the default value to return instead.

I can fix it myself if I have time, but just letting you know if you have any suggestions or you want to fix it yourself.