Skip to content

Enhance Discord logging with chunked messages - #35

Open
Rushaway wants to merge 1 commit into
masterfrom
Rushaway-patch-1
Open

Enhance Discord logging with chunked messages#35
Rushaway wants to merge 1 commit into
masterfrom
Rushaway-patch-1

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Added support for Discord message chunking and improved webhook message handling.

Added support for Discord message chunking and improved webhook message handling.
Copilot AI review requested due to automatic review settings July 30, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the AdminLogging SourcePawn plugin to better handle Discord’s message size limits by chunking long admin log payloads and serializing webhook sends via an internal queue.

Changes:

  • Added Discord content sizing constants and a send-queue (ArrayList) with sequential dispatch.
  • Implemented chunked code-block formatting for log messages and refactored header construction into BuildAdminLogHeader.
  • Bumped plugin version to 1.4.0 and adjusted message escaping/formatting to suit code-block output.

Comment on lines +358 to 360
stock void SendWebHook(char sMessage[WEBHOOK_MSG_MAX_SIZE + 1], char sWebhookURL[WEBHOOK_URL_MAX_SIZE], int iMsgIndex = -1, int iRetries = 0)
{
/* Webhook UserName */
}

stock void SendWebHook(char sMessage[WEBHOOK_MSG_MAX_SIZE], char sWebhookURL[WEBHOOK_URL_MAX_SIZE], int iMsgIndex = -1, int iRetries = 0)
stock void SendWebHook(char sMessage[WEBHOOK_MSG_MAX_SIZE + 1], char sWebhookURL[WEBHOOK_URL_MAX_SIZE], int iMsgIndex = -1, int iRetries = 0)

if (g_hSendQueue == null)
{
LogError("Send queue is not initialized.");
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.

2 participants