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

feat: added warnings for certain events that require an intent #1169

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

Conversation

Jaskowicz1
Copy link
Contributor

This PR adds warnings for some events (guild member events and presence update) if the user does not have the specific intent required.

As these events do not fire from Discord if the intent wasn't specified, I could not use the set_warning_callback feature.

This is to try and inform users about what went wrong and how they can fix it, to try be more user friendly as D++ is currently silent about it (see link a and link b).

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@Jaskowicz1 Jaskowicz1 self-assigned this Jun 13, 2024
Copy link

netlify bot commented Jun 13, 2024

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit 16917aa
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/666ab1bfecac7b000895c452
😎 Deploy Preview https://deploy-preview-1169--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the code Improvements or additions to code. label Jun 13, 2024
Copy link
Contributor

@braindigitalis braindigitalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about if the user hooks the event after starting the cluster?
also, while looking at this do we make the one for messages less spammy too? basically make them all emit once?

@Jaskowicz1
Copy link
Contributor Author

what about if the user hooks the event after starting the cluster?

Couldn't come up with a solution to that, that didn't involve constantly checking every second if the events have been bound to, when I was writing this (and I still don't have a solution).

also, while looking at this do we make the one for messages less spammy too? basically make them all emit once?

Either that or add something like bot.suppress_warnings(true); to prevent warning logs for this (for people who do know what they're doing)? I think being spammy drills in the idea that they're doing something wrong to people who might not understand.

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

Successfully merging this pull request may close these issues.

None yet

2 participants