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: dpp::utility::if_success, a shortcut for callbacks #972

Closed
wants to merge 6 commits into from

Conversation

Mishura4
Copy link
Member

@Mishura4 Mishura4 commented Oct 24, 2023

Convenience function to generate a function suitable for use as a callback to API calls. On success calls the given function, on error log the error to the cluster.

Example:

bot.message_create(message, dpp::utility::if_success([&bot](const dpp::message &m) {
	bot.log(dpp::ll_info, "message sent successfully");
}));

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.

@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit 51a0ef0
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/65401d0d3160290008a6b51e
😎 Deploy Preview https://deploy-preview-972--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 documentation Improvements or additions to documentation code Improvements or additions to code. labels Oct 24, 2023
Copy link
Contributor

This pull request has had no activity and is being marked as stale. If you still wish to continue with this pull request please comment to reopen it.

@github-actions github-actions bot added the Stale label Dec 31, 2023
@github-actions github-actions bot closed this Jan 7, 2024
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. documentation Improvements or additions to documentation Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant