Skip to content

Commit

Permalink
Merge branch 'dev' into fix_erroring_log_error
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored May 1, 2024
2 parents c10975d + 70077e8 commit 2c2ae17
Show file tree
Hide file tree
Showing 31 changed files with 885 additions and 56 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- { arch: 'arm64', concurrency: 4, os: [self-hosted, linux, ARM64], package: g++-12, cpp-version: g++-12, cmake-flags: '', cpack: 'yes', ctest: 'no' }
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- { arch: 'arm64', concurrency: 2, os: [self-hosted, ARM64, macOS], cpp-version: clang++-15, cmake-flags: ''}
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
runs-on: ${{matrix.cfg.os}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
runs-on: ${{matrix.cfg.os}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand All @@ -50,7 +50,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -65,6 +65,6 @@ jobs:
make -j2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/construct-vcpkg-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

- name: Setup PHP
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2
with:
php-version: '8.1'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce # v4.1.3
uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cancel-in-progress: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand All @@ -47,7 +47,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
push: true
tags: brainboxdotcc/dpp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

- name: Setup PHP
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2
with:
php-version: '8.0'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gitguardian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
cancel-in-progress: true
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down Expand Up @@ -72,6 +72,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/sitemap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/target-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

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 @@ -25,7 +25,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal@sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9c35d
FROM ubuntu:focal@sha256:71b82b8e734f5cd0b3533a16f40ca1271f28d87343972bb4cd6bd6c38f1bd38e

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y libssl-dev zlib1g-dev libsodium-dev libopus-dev cmake pkg-config g++ gcc git make && apt-get clean && rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion doxygen-awesome-css
66 changes: 66 additions & 0 deletions include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,24 @@ class DPP_EXPORT cluster {
*/
event_router_t<message_create_t> on_message_create;

/**
* @brief Called when a vote is added to a message poll.
*
* @see https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
* @note Use operator() to attach a lambda to this event, and the detach method to detach the listener using the returned ID.
* The function signature for this event takes a single `const` reference of type message_poll_vote_add_t&, and returns void.
*/
event_router_t<message_poll_vote_add_t> on_message_poll_vote_add;

/**
* @brief Called when a vote is removed from a message poll.
*
* @see https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
* @note Use operator() to attach a lambda to this event, and the detach method to detach the listener using the returned ID.
* The function signature for this event takes a single `const` reference of type message_poll_vote_remove_t&, and returns void.
*/
event_router_t<message_poll_vote_remove_t> on_message_poll_vote_remove;

/**
* @brief Called when a guild audit log entry is created.
*
Expand Down Expand Up @@ -1948,6 +1966,54 @@ class DPP_EXPORT cluster {
*/
void message_delete_bulk(const std::vector<snowflake> &message_ids, snowflake channel_id, command_completion_event_t callback = utility::log_error());

/**
* @brief Get a list of users that voted for this specific answer.
*
* @param m Message that contains the poll to retrieve the answers from
* @param answer_id ID of the answer to retrieve votes from (see poll_answer::answer_id)
* @param after Users after this ID should be retrieved if this is set to non-zero
* @param limit This number of users maximum should be returned, up to 100
* @param callback Function to call when the API call completes.
* @see https://discord.com/developers/docs/resources/poll#get-answer-voters
* On success the callback will contain a dpp::user_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
*/
void poll_get_answer_voters(const message& m, uint32_t answer_id, snowflake after, uint64_t limit, command_completion_event_t callback = utility::log_error());

/**
* @brief Get a list of users that voted for this specific answer.
*
* @param message_id ID of the message with the poll to retrieve the answers from
* @param channel_id ID of the channel with the poll to retrieve the answers from
* @param answer_id ID of the answer to retrieve votes from (see poll_answer::answer_id)
* @param after Users after this ID should be retrieved if this is set to non-zero
* @param limit This number of users maximum should be returned, up to 100
* @param callback Function to call when the API call completes.
* @see https://discord.com/developers/docs/resources/poll#get-answer-voters
* On success the callback will contain a dpp::user_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
*/
void poll_get_answer_voters(snowflake message_id, snowflake channel_id, uint32_t answer_id, snowflake after, uint64_t limit, command_completion_event_t callback = utility::log_error());

/**
* @brief Immediately end a poll.
*
* @param m Message that contains the poll
* @param callback Function to call when the API call completes.
* @see https://discord.com/developers/docs/resources/poll#end-poll
* On success the callback will contain a dpp::message object representing the message containing the poll in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
*/
void poll_end(const message &m, command_completion_event_t callback = utility::log_error());

/**
* @brief Immediately end a poll.
*
* @param message_id ID of the message with the poll to end
* @param channel_id ID of the channel with the poll to end
* @param callback Function to call when the API call completes.
* @see https://discord.com/developers/docs/resources/poll#end-poll
* On success the callback will contain a dpp::message object representing the message containing the poll in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
*/
void poll_end(snowflake message_id, snowflake channel_id, command_completion_event_t callback = utility::log_error());

/**
* @brief Get a channel
*
Expand Down
52 changes: 52 additions & 0 deletions include/dpp/cluster_coro_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,58 @@
*/
[[nodiscard]] async<confirmation_callback_t> co_message_unpin(snowflake channel_id, snowflake message_id);

/**
* @brief Get a list of users that voted for this specific answer.
*
* @param m Message that contains the poll to retrieve the answers from
* @param answer_id ID of the answer to retrieve votes from (see poll_answer::answer_id)
* @param after Users after this ID should be retrieved if this is set to non-zero
* @param limit This number of users maximum should be returned, up to 100
* @return user_map returned object on completion
* @see dpp::cluster::poll_get_answer_voters
* @see https://discord.com/developers/docs/resources/poll#get-answer-voters
* \memberof dpp::cluster
*/
[[nodiscard]] async<confirmation_callback_t> co_poll_get_answer_voters(const message& m, uint32_t answer_id, snowflake after, uint64_t limit);

/**
* @brief Get a list of users that voted for this specific answer.
*
* @param message_id ID of the message with the poll to retrieve the answers from
* @param channel_id ID of the channel with the poll to retrieve the answers from
* @param answer_id ID of the answer to retrieve votes from (see poll_answer::answer_id)
* @param after Users after this ID should be retrieved if this is set to non-zero
* @param limit This number of users maximum should be returned, up to 100
* @return user_map returned object on completion
* @see dpp::cluster::poll_get_answer_voters
* @see https://discord.com/developers/docs/resources/poll#get-answer-voters
* \memberof dpp::cluster
*/
[[nodiscard]] async<confirmation_callback_t> co_poll_get_answer_voters(snowflake message_id, snowflake channel_id, uint32_t answer_id, snowflake after, uint64_t limit);

/**
* @brief Immediately end a poll.
*
* @param m Message that contains the poll
* @return message returned object on completion
* @see dpp::cluster::poll_end
* @see https://discord.com/developers/docs/resources/poll#end-poll
* \memberof dpp::cluster
*/
[[nodiscard]] async<confirmation_callback_t> co_poll_end(const message &m);

/**
* @brief Immediately end a poll.
*
* @param message_id ID of the message with the poll to end
* @param channel_id ID of the channel with the poll to end
* @return message returned object on completion
* @see dpp::cluster::poll_end
* @see https://discord.com/developers/docs/resources/poll#end-poll
* \memberof dpp::cluster
*/
[[nodiscard]] async<confirmation_callback_t> co_poll_end(snowflake message_id, snowflake channel_id);

/**
* @brief Get a channel's pins
* @see dpp::cluster::channel_pins_get
Expand Down
Loading

0 comments on commit 2c2ae17

Please sign in to comment.