Skip to content

Commit

Permalink
docs: added all file changes from #820 (#990)
Browse files Browse the repository at this point in the history
Co-authored-by: Craig Edwards (Brain) <[email protected]>
  • Loading branch information
Jaskowicz1 and braindigitalis authored Nov 2, 2023
1 parent f14e8a6 commit 223e0a1
Show file tree
Hide file tree
Showing 68 changed files with 786 additions and 728 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
"STDCORO",
"NOMINMAX",
"sku",
"skus"
"skus",
"Codecademy"
],
"flagWords": [
"hte"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-docs-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
submodules: recursive

- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install -y g++-12 libsodium-dev libopus-dev zlib1g-dev libmpg123-dev liboggz-dev cmake libfmt-dev
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install -y g++-12 libsodium-dev libopus-dev zlib1g-dev libmpg123-dev liboggz-dev cmake libfmt-dev libopusfile-dev

- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=T_fallback -DDPP_CORO=ON -DCMAKE_BUILD_TYPE=Debug ..
Expand Down
14 changes: 5 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ When contributing to this repository, please do not feel intimidated! We welcome
## Pull Request Process

1. Pull requests should be made against the `dev` branch.
2. Ensure that the changed library can be built on your target system. Do not introduce any platform-
specific code.
2. Ensure that the changed library can be built on your target system. Do not introduce any platform specific code.
3. Ensure that all methods and functions you add are **fully documented** using doxygen style comments.
4. Test your commit! Make a simple single-file test bot to demonstrate the change, include this with the PR
as an attached file on a comment, so we can test and see how it works.
4. Test your commit! Make a simple single-file test bot to demonstrate the change, include this with the PR as an attached file on a comment, so we can test and see how it works.
5. Ensure that you do not break any existing API calls without discussing on Discord first!
6. Be sure to follow the coding style guide (if you are not sure, match the code style of existing files
including indent style etc).
7. Your PR must pass the CI actions before being allowed to be merged. Our PR actions check that the
build will compile on various platforms before release and makes precompiled versions of the library.
8. Automated changes e.g. via grammarly or a static analysis tool will not usually be accepted into the code without proper thought out justification (by a human being, not an AI or an App) as to why the changes are required. Generally a PR should do more than fix a single spelling error for example as this just takes precious time for something which could be resolved a direct commit to the dev branch.
6. Be sure to follow the coding style guide (if you are not sure, match the code style of existing files including indent style etc.).
7. Your PR must pass the CI actions before being allowed to be merged. Our PR actions check that the build will compile on various platforms before release and make precompiled versions of the library.
8. Automated changes e.g. via Grammarly or a static analysis tool will not usually be accepted into the code without proper thought out justification (by a human being, not an AI or an App) as to why the changes are required. Generally a PR should do more than fix a single spelling error for example as this just takes precious time for something which could have been resolved by a direct commit to the dev branch.
75 changes: 41 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<h3>An incredibly lightweight C++ Discord library</h3>
<br />

[![Discord](https://img.shields.io/discord/825407338755653642?style=flat)](https://discord.gg/dpp)
[![Discord](https://img.shields.io/discord/825407338755653642?style=flat)](https://discord.gg/dpp)
![Downloads](https://dl.dpp.dev/dlcount.php)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/39b054c38bba411d9b25b39524016c9e)](https://www.codacy.com/gh/brainboxdotcc/DPP/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=brainboxdotcc/DPP&amp;utm_campaign=Badge_Grade) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7726/badge)](https://bestpractices.coreinfrastructure.org/projects/7726)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/39b054c38bba411d9b25b39524016c9e)](https://www.codacy.com/gh/brainboxdotcc/DPP/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=brainboxdotcc/DPP&amp;utm_campaign=Badge_Grade) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7726/badge)](https://bestpractices.coreinfrastructure.org/projects/7726)
[![D++ CI](https://github.com/brainboxdotcc/DPP/actions/workflows/ci.yml/badge.svg)](https://github.com/brainboxdotcc/DPP/actions/workflows/ci.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/brainboxdotcc/DPP/badge)](https://securityscorecards.dev/viewer/?uri=github.com/brainboxdotcc/DPP)
[![AUR version](https://img.shields.io/aur/version/dpp)](https://aur.archlinux.org/packages/dpp)
Expand All @@ -15,10 +15,9 @@

<hr />


D++ is a lightweight and efficient library for **Discord** written in **modern C++**, covering as much of the API specification as possible with an **incredibly small memory footprint** even when caching large amounts of data.

### Library features:
### Library Features

* Support for Discord API v10
* Really small memory footprint
Expand All @@ -29,7 +28,7 @@ D++ is a lightweight and efficient library for **Discord** written in **modern C
* [Voice support](https://dpp.dev/soundboard.html) (sending **and** receiving audio)
* The entire Discord API is available for use in the library
* Stable [Windows support](https://dpp.dev/buildwindows.html)
* Ready-made compiled packages for Windows, Raspberry Pi (ARM64/ARM7/ARMv6), Debian x86/x64 and RPM based distributions
* Ready-made compiled packages for Windows, Raspberry Pi (ARM64/ARM7/ARMv6), Debian x86/x64, and RPM based distributions
* Highly scalable for large amounts of guilds and users

Want to help? Drop me a line or send a PR.
Expand All @@ -46,48 +45,54 @@ The documentation is constantly evolving and improving, generated from the code

This is a simple ping-pong example using slash commands.

```c++
```cpp
#include <dpp/dpp.h>
#include <cstdlib>

int main() {
dpp::cluster bot(std::getenv("BOT_TOKEN"));

bot.on_slashcommand([](auto event) {
if (event.command.get_command_name() == "ping") {
event.reply("Pong!");
}
});

bot.on_ready([&bot](auto event) {
if (dpp::run_once<struct register_bot_commands>()) {
bot.global_command_create(
dpp::slashcommand("ping", "Ping pong!", bot.me.id)
);
}
});

bot.start(dpp::st_wait);
dpp::cluster bot(std::getenv("BOT_TOKEN"));

bot.on_slashcommand([](auto event) {
if (event.command.get_command_name() == "ping") {
event.reply("Pong!");
}
});

bot.on_ready([&bot](auto event) {
if (dpp::run_once<struct register_bot_commands>()) {
bot.global_command_create(
dpp::slashcommand("ping", "Ping pong!", bot.me.id)
);
}
});

bot.start(dpp::st_wait);
return 0;
}
```

You can find more examples in our [example page](https://dpp.dev/md_docpages_03_example_programs.html).
You can find more examples in our [example page](https://dpp.dev/example-programs.html).

## 💻 Supported Systems

### Linux

The library runs ideally on **Linux**.

### Mac OS X and FreeBSD and OpenBSD
The library is well-functional and stable on **Mac OS X** and **FreeBSD** and **OpenBSD** too.

The library is well-functional and stable on **Mac OS X**, **FreeBSD**, and **OpenBSD** too.

### Raspberry Pi

For running your bot on a **Raspberry Pi**, we offer a prebuilt .deb package for ARM64, ARM6, and ARM7 so that you do not have to wait for it to compile.

### Windows

**Windows** is well-supported with ready-made compiled DLL and LIB files, please check out our [Windows Bot Template repository](https://github.com/brainboxdotcc/windows-bot-template). The Windows Bot repository can be cloned and integrated immediately into any Visual Studio 2019 and 2022 project in a matter of minutes.

### Other OS

The library should work fine on other operating systems as well, and if you run a D++ bot on something not listed here, please let us know!

## 🔰 Getting Started
Expand All @@ -110,15 +115,13 @@ If you prefer to use Nightly Builds (This is only if you know what you are doing

## 🤝 Contributing

Contributions, issues and feature requests are welcome. After cloning and setting up project locally, you can just submit
a PR to this repo and it will be deployed once it's accepted.
Contributions, issues and feature requests are welcome. After cloning and setting up the project locally, you can just submit a PR to this repo and it will be deployed once it's accepted.

Please read the [D++ Code Style Guide](https://dpp.dev/coding-standards.html) for more information on how we format pull requests.

## 💬 Get in touch

If you have various suggestions, questions or want to discuss things with our community, [Join our discord server](https://discord.gg/dpp)!
Make a humorous reference to brains in your nickname to get access to a secret brain cult channel! :)
If you have various suggestions, questions or want to discuss things with our community, [Join our discord server](https://discord.gg/dpp)! Make a humorous reference to brains in your nickname to get access to a secret brain cult channel! :)

[![Discord](https://img.shields.io/discord/825407338755653642?style=flat)](https://discord.gg/dpp)

Expand All @@ -129,26 +132,30 @@ We love people's support in growing and improving. Be sure to leave a ⭐️ if
## 📂 Dependencies

### Build requirements

* [cmake](https://cmake.org/) (version 3.13+)
* A supported C++ compiler from the list below

### Supported compilers

* [g++](https://gcc.gnu.org) (version 8 or higher)
* [clang](https://clang.llvm.org/) (version 6 or higher)
* AppleClang (12.0 or higher)
* Microsoft Visual Studio 2019 or 2022 (16.x/17.x)
* [mingw-w64](https://www.mingw-w64.org/) (gcc version 8 or higher)

Other compilers may work (either newer versions of those listed above, or different compilers entirely) but have not been tested by us.

### External Dependencies (You must install these)

* [OpenSSL](https://openssl.org/) (whichever `-dev` package comes with your OS)
* [zlib](https://zlib.net) (whichever `-dev` package comes with your OS)

#### Optional Dependencies

For voice support you require both of:
* [LibOpus](https://www.opus-codec.org)
* [libsodium](https://github.com/jedisct1/libsodium)
* [libopus](https://www.opus-codec.org)
* [libsodium](https://libsodium.org/)

### Included Dependencies (Packaged with the library)
* [nlohmann::json](https://github.com/nlohmann/json)

* [JSON for Modern C++](https://json.nlohmann.me/)
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

## Reporting a Vulnerability

To report a vulnerability please contact the development team confidentially on Discord by contacting `@brain` via a DM on https://discord.gg/dpp - We will discuss via a group chat if necessary and action
the fix. Vulnerabilties are actioned and fixed within a 30 day window. Once the fix has been put into a release version, the vulnerability will be disclosed to the public.
To report a vulnerability please contact the development team confidentially on Discord by contacting `@brain` via a DM on https://discord.gg/dpp - We will discuss via a group chat if necessary and action the fix. Vulnerabilities are actioned and fixed within a 30 day window. Once the fix has been put into a release version, the vulnerability will be disclosed to the public.
Loading

0 comments on commit 223e0a1

Please sign in to comment.