zLeki/Liquid-Gen

If someone enters /gen [NOT A STRING/INT] or [INCORRECT INPUT] program crashes and adds what they typed to DB

Closed this issue · 5 comments

XMVZ commented

really need a fix for this..
otherwise the bot is AMAZING THANK YOU.

XMVZ commented

hmmm tried starting from scratch and now it's even worse... console prints ADDED COMMAND 3 times for each command and seems to have an open action as well..

past that, if i try to gen (even having set premium to 1 manually in DB) when i try to gen i get the "this server has too many members blah blah" error...

please help. so close.

XMVZ commented

now im here...

2022/12/26 02:11:21 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:11:35 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:11:44 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:11:47 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:11:48 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:12:04 0
[config valNA valEU crunchyroll spotify spotifyPREM]
1118 821 juansuyama@hotmail.com:Juansuyama1
2022/12/26 02:12:53 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string
2022/12/26 02:13:09 [DG0] wsapi.go:585:onEvent() error unmarshalling PRESENCE_UPDATE event, json: cannot unmarshal number into Go struct field PresenceUpdate.activities of type string

bot works for a bit then completely breaks down

zLeki commented

Sorry, i'm here i'll take a look and get back to you asap

zLeki commented

Could you elaborate? It shouldn't be possible for the user to enter anything but a string since the queries are required

XMVZ commented

I ended up creating my own gen in python as I unfortunately became too frustrated with the bot crashing with almost any query. admittedly filed this issue late at night and am retroactively realizing it makes no sense as currently read.

error was essentially -

  • if a user queries with a string that does not match the syntax of the item being called/genned exactly it will crash.
  • if a user queries with a string that does not exist in the database (IE is not a gennable variable which exists in stock) it will crash.

i wish i had saved the errors or logs, but unfortunately i don't have those files any more! wish i could be of more assistance and best of luck fixing it :)