Skip to content

Fix: Several mistakes in docs#791

Closed
wizard7377 wants to merge 1 commit intobrainboxdotcc:devfrom
wizard7377:docs_fix
Closed

Fix: Several mistakes in docs#791
wizard7377 wants to merge 1 commit intobrainboxdotcc:devfrom
wizard7377:docs_fix

Conversation

@wizard7377
Copy link
Copy Markdown
Contributor

Fixes for several trivial mistakes in docs, including spelling, grammar, and incorrect/outdated information.

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 21, 2023

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit e464100
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/64e391699a75310008a55f78
😎 Deploy Preview https://deploy-preview-791--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
Copy Markdown

CLAassistant commented Aug 21, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@Mishura4 Mishura4 left a comment

Choose a reason for hiding this comment

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

This review only applies to advanced_reference/coroutines.md, I haven't looked at the other files.

advanced_reference/coroutines.md is going to receive a lot of changes in #763, please wait until it is merged (or remove the changes from this PR and I can add them on my end)

### What is a coroutine?

Introduced in C++20, coroutines are the solution to the impracticality of callbacks. In short, a coroutine is a function that can be paused and resumed later : they are an extremely powerful alternative to callbacks for asynchronous APIs in particular, as the function can be paused when waiting for an API response, and resumed when it is received.
Introduced in C++20, coroutines are the solution to the impracticality of callbacks. In short, a coroutine is a function that can be paused and resumed later: they are an extremely powerful alternative to callbacks, for asynchronous APIs in particular, as the function can be paused when waiting for an API response, and resumed when it is received.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This extra colon makes it harder to read, can you remove it?


\attention As a rule of thumb when making dpp::task objects and in general coroutines, always prefer taking parameters by value and avoid capture : this may be confusing but a coroutine is *not* the lambda creating it, the captures are not bound to it and the code isn't ran inside the lambda. The lambda that returns a dpp::task simply returns a task object containing the code, which goes on to live on its own, separate from the lambda.
Similarly, with reference parameters, the object they reference to might be destroyed while the coroutine is suspended and resumed in another thread, which is why you want to pass by value. See also [lambdas and locals](/lambdas-and-locals.html) except this also applies to parameters in the case of coroutines.
\attention As a rule of thumb when making `dpp::task` objects, and in general for coroutines, always prefer taking parameters by value and avoid captures: this may be confusing but a coroutine is *not* the lambda creating it, the captures are not bound to it and the code isn't run inside the lambda. The lambda that returns a `dpp::task` object containing the code, which goes on to live on its own, separate from the lambda.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also remove this colon for the same reason as above?
The rest of the changes on this line are fine.

\note The next example assumes you are already familiar with how to use [slash commands](/firstbot.html), [parameters](/slashcommands.html), and [sending files through a command](/discord-application-command-file-upload.html).

Coroutines allow to write asynchronous functions almost as if they were executed synchronously, without the need for callbacks, which can save a lot of pain with keeping track of different data. Here is another example of what is made easier with coroutines : an "addemoji" command taking a file and a name as a parameter. This means downloading the emoji, submitting it to Discord, and finally replying, with some error handling along the way.
Coroutines allows creation of asynchronous functions almost as if they were executed synchronously, without the need for callbacks, which can save a lot of pain with keeping track of different data. Here is another example of what is made easier with coroutines: an "addemoji" command taking a file and a name as parameters. This means downloading the emoji, submitting it to Discord, and finally replying, with some error handling along the way.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is wrong, Coroutines is plural so you'd say allow. Regardless this entire section will be removed in #763

@wizard7377 wizard7377 closed this Aug 21, 2023
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need to change /var/lib/jenkins/ to /var/lib/jenkins

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.

4 participants