Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix: Small issues with docs #794

Closed
wants to merge 4 commits into from
Closed

Fix: Small issues with docs #794

wants to merge 4 commits into from

Conversation

wizard7377
Copy link
Contributor

Just a fix of several small issues in the D++ docs

@netlify
Copy link

netlify bot commented Aug 22, 2023

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit 224e5c4
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/64e4c6866fbc3d0008f9914e
😎 Deploy Preview https://deploy-preview-794--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.

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2023

CLA assistant check
All committers have signed the CLA.


\image html buildhistoryjenkins.png

### Running the build

Running the builds is the same as any other time, but we'll still cover it! However, we won't cover running it in background and whatnot, that part is completely down to you.

First, you need to get into the jenkins user. If you're like me and don't have the Jenkins user password, you can login with your normal login (that has sudo perms) and do `sudo su - jenkins`. Once logged in, you'll be in `/var/lib/jenkins/`. From here, you'll want to do `cd workspace/DiscordBot` (make sure to replace "DiscordBot" with your bot's name. Remember, you can tab-complete this) and then `cd build`. Now, you can simply do `./DiscordBot`!
First, you need to get into the jenkins user. If you're like me and don't have the Jenkins user password, you can login with your normal login (that has sudo perms) and do `sudo su - jenkins`. Once logged in, you'll be in `/var/lib/jenkins`. From here, you'll want to do `cd workspace/DiscordBot` (make sure to replace "DiscordBot" with your bot's name. Remember, you can tab-complete this) and then `cd build`. Now, you can simply do `./DiscordBot`!
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrequired change, they do the exact same thing.

#include <dpp/dpp.h>

int main() {
dpp::cluster bot("token", dpp::i_default_intents | dpp::i_message_content);

bot.on_log(dpp::utility::cout_logger());

bot.on_slashcommand.co_attach([](dpp::slashcommand_t event) -> dpp::job {
bot.on_slashcommand.co_attach([](dpp::slashcommand_t event) -> dpp::task<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is undoing PR #763, putting it back to the inaccurate version.


### I heard you liked tasks

\note This next example is fairly advanced and makes use of many of both C++ and D++'s advanced features.

Earlier we mentioned two other types of coroutines provided by dpp : `dpp::coroutine<R>` and `dpp::task<R>`. They both take their return type as a template parameter, which may be void. Both `dpp::job` and `dpp::task<R>` start on the constructor for asynchronous execution, however only the latter can be co_await-ed, this allows you to retrieve its return value. If a `dpp::task<R>` is destroyed before it ends, it is cancelled and will stop when it is resumed from the next `co_await`. `dpp::coroutine<R>` also has a return value and can be co_await-ed, however it only starts when co_await-ing, meaning it is executed synchronously.
Copy link
Contributor

Choose a reason for hiding this comment

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

Removal of #763 again

@@ -177,7 +351,7 @@ int main() {
};

// Send a "<bot> is thinking..." message, to wait on later so we can edit
dpp::async thinking = event.co_thinking(false);
dpp::awaitable thinking = event.co_thinking(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be dpp::async


Here is an example of a command making use of `dpp::task<R>` to retrieve the avatar of a specified user, or if missing, the sender :
Here is an example of a command making use of that to retrieve the avatar of a specified user, or if missing, the sender:
Copy link
Contributor

Choose a reason for hiding this comment

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

Removal of #763

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.

theres far too much change in this which is change for changes sake. Its very hard to review.
For example insertion of random blank lines, which dont affect anything. Please revert the pointless changes and keep the PR simple. What is it actually out to fix?

@wizard7377 wizard7377 closed this Aug 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants