Rhgx7 / WebTest

0 stars 0 forks source link

Server is missing serverDocument / serverDocument is not being created #1

Closed TextBox75 closed 2 years ago

TextBox75 commented 2 years ago

Please describe the problem you are having in as much detail as possible: Login in the bot with a token/clientID/secret and such using a bot-account that has already joined on a server BEFORE using/starting the GAwesomeBot the first time causes the bot to not create needed collections in mongodb.

I have a Testbot-account that i used for testing/looking into alot of different discord bots and because of that the account was already on a server(having full admin perms because its just a testserver). When i started the bot and tried to use commands the bot didnt react and this where the logs for these events:

(ID's and unimportant data replaced with XXX) {"content":"<@!MENTION>","msgid":"XXX","svrid":"XXX","chid":"XXX","usrid":"XXX","level":"verbose","message":"Successfully finished handling Discord Message. CommandHandler took: 0s 23ms","timestamp":"XXX"} {"svrid":"XXX","level":"warn","message":"Could not satisfy SpamHandler because XXX(serverid) is missing a Document.","timestamp":"XXX"}

It was also not possible to make any configs in the dashboard because of the missing serverDocument The fix was simple, have the bot leave and rejoin the server WHILE the bot is running.

The problem i see here (if NOT fixed in whatever version you are running on your official botsource now) that IF someone invite the bot to his server WHILE it has issues i.e. shardproblems or while the out it which will lead to him thinking the bot is shit and just goes with something else. I haven't looked through the whole source yet BUT the logs indicate that the bot is "Ensuring all guilds have a serverDocument" which is NOT the case as far i see it.

Include some reproduction steps (How can we cause the bug to happen?): Create a botaccount - join a testserver with the account before using the bot the first time with the indev-4.0.2 branch then write whatever in chat, try to mention the bot or execute any commands, try to make settings/setup for the server in the dashboard

Further details:

TextBox75 commented 2 years ago

sunlust wad_MAP30

Rhgx7 commented 2 years ago

WTF? is this