Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Server is missing serverDocument / serverDocument is not being created on bot-startup #757

Open
2 tasks done
githubuserzero opened this issue Nov 26, 2020 · 0 comments
Open
2 tasks done

Comments

@githubuserzero
Copy link

githubuserzero commented Nov 26, 2020

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 bot is offline the user will get problems when he tries to use your bot because its missing documents and the user can't even know about 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:

  • The problem occurs on a self-host

  • Node.JS version (If applicable): 15.3.0

  • Operating System (If applicable): Ubuntu 18.04.2 LTS / Win10

  • GAwesomeBot version AND branch: Version? 4.01 or 5.0.0 depends where you look in the source - Branch is indev-4.0.2

  • Priority this issue should have – please be realistic and elaborate if possible:

    • Low (Only partially affects the usage of a feature or command)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant