diff options
| author | Fuwn <[email protected]> | 2025-10-24 19:29:50 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-24 19:29:50 -0700 |
| commit | eb253868b78451c0123fdf13de19b7cd0c124f48 (patch) | |
| tree | eb9a6f278eade65ef0bc8621916c1afff039b1ae | |
| parent | feat(gateway:commands): Add webhook utility commands (diff) | |
| download | umabotdiscord-eb253868b78451c0123fdf13de19b7cd0c124f48.tar.xz umabotdiscord-eb253868b78451c0123fdf13de19b7cd0c124f48.zip | |
feat(gateway:commands): Add gate to webhook utility commands
| -rw-r--r-- | packages/gateway/src/commands/deleteWebhook.ts | 5 | ||||
| -rw-r--r-- | packages/gateway/src/commands/webhook.ts | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/gateway/src/commands/deleteWebhook.ts b/packages/gateway/src/commands/deleteWebhook.ts index 7408c17..92fc89c 100644 --- a/packages/gateway/src/commands/deleteWebhook.ts +++ b/packages/gateway/src/commands/deleteWebhook.ts @@ -6,6 +6,11 @@ export const handleDeleteWebhookCommand = async ( ): Promise<boolean> => { if (message.author.bot) return false; + const application = await message.client.application?.fetch(); + const ownerId = application?.owner?.id; + + if (message.author.id !== ownerId) return false; + const content = message.content.trim(); const commandMatch = content.match(/^uma!delwh\s+(\d+)\s*,\s*(.+)$/s); diff --git a/packages/gateway/src/commands/webhook.ts b/packages/gateway/src/commands/webhook.ts index a3b6b72..a524d8a 100644 --- a/packages/gateway/src/commands/webhook.ts +++ b/packages/gateway/src/commands/webhook.ts @@ -88,6 +88,11 @@ export const handleWebhookCommand = async ( ): Promise<boolean> => { if (message.author.bot) return false; + const application = await message.client.application?.fetch(); + const ownerId = application?.owner?.id; + + if (message.author.id !== ownerId) return false; + const content = message.content.trim(); const commandMatch = content.match( /^uma!wh\s+(\d+)\s*,\s*([^\s,]+)\s*,\s*([^,]+)\s*,\s*(.+)$/s, |