-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Conversation
✅ Deploy Preview for dpp-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
\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`! |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal of #763
There was a problem hiding this 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?
Just a fix of several small issues in the D++ docs