Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store /search command in mongo db #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasWu931
Copy link

@ThomasWu931 ThomasWu931 commented Sep 2, 2022

Problem

We want the /search command to be recorded into the mongoldb client.

Solution

Following the current convention for slash_remove and slash_delete, we add the @log_command decorator to slash_search. Now log_command is called to manage search commands.

Next Steps

Since log_command decorator is used, this means that log_command is called prior to DiscordFS.locate. This means that ctx.defer(hidden=kwargs.get("dm", False)) is called after the slash command has been saved to the data base by log_command. This can be an issue if log_command takes too long which will raise a time out error by the discord api (Top answer here).

TLDR: Defering the msg should be called first before we store the command or anything else.

@dhrumilp15
Copy link
Owner

Sounds good - we've refactored a lot of the metrics logging to the discord server itself (no more space in mongodb, but mongodb is better to store more information).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants