Galarzaa90 / NabBot

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

ValueError when adding players and BAD REQUEST error doing /whois with multiple registered characters to a user #15

Closed rymaster62 closed 7 years ago

rymaster62 commented 7 years ago

Here are two examples of two character names that yielded the same error.

/stalk addchar Friendly Maker,Twisted Core ValueError: invalid literal for int() with base 10: ''

/stalk addchar peasize death head - swartzy, peasize death head ValueError: invalid literal for int() with base 10: ''

Other character names are able to be registered to these users, just not those characters.

Also, we have been registering our hunted character list to a user since the bot currently lacks a hunted list. When we register about +10 players to the user, it starts yielding this error.

/whois HUNTED!!!! HTTPException: BAD REQUEST (status code: 400)

Sorry, at this time, I do not have access to the server log. If you need it, just say so and I can paste what it says at a later time. BTW, love this bot! Ty for setting this up, it's been awesome for us! <3

Galarzaa90 commented 7 years ago

The console log would be really useful.

About the HTTPException error, it's because the character list gets too big and exceeds discord's message length limit, so it throws an error. The hunted list feature is something that has been on my to-do list for a while, but right now I'm working on rewriting for a future update.

rymaster62 commented 7 years ago

Okay, I'll post it as soon as I can, thanks for the fast reply!

Galarzaa90 commented 7 years ago

I found the reason for the error, these characters have deaths without a level: image

That last death is causing the problem, cause it doesn't contain a level, so it's causing errors in the script. I don't play in pvp, so I don't why he has an entry like that, if you have any explanation for that, let me know.

Either way, I will fix it so it ignores it.

rymaster62 commented 7 years ago

Yeah, for some reason tibia doesn't list a level sometimes when you die in pvp. It's rare but it happens. I believe it happens only when no one takes a full frag on you and they only assist.

Galarzaa90 commented 7 years ago

Alright, for now those deaths will be totally ignored as they kinda break the way deaths are managed by NabBot.

rymaster62 commented 7 years ago

Oh, i know why! It's because that character was in party with the people that killed him, so they don't get counted for a full frag.