Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## What does this PR do?

<!-- Describe the change clearly. What problem does it solve? Why is this approach the right one? -->
<!-- Describe the problem, the root cause, and how you solved it.
The diagnosis (what was actually happening and why) is as important as the fix itself. -->



Expand Down Expand Up @@ -38,7 +39,9 @@ Fixes #

## Checklist

<!-- Complete these before requesting review. -->
<!-- Complete these before requesting review.
Tip: Check N/A boxes to show you've considered them — a checked N/A is more
informative than an unchecked box. Fill in every section or say why you skipped it. -->

### Code

Expand All @@ -48,6 +51,7 @@ Fixes #
- [ ] My PR contains **only** changes related to this fix/feature (no unrelated commits)
- [ ] I've run `pytest tests/ -q` and all tests pass
- [ ] I've added tests for my changes (required for bug fixes, strongly encouraged for features)
- [ ] I've noted any pre-existing test failures outside my change
- [ ] I've tested on my platform: <!-- e.g. Ubuntu 24.04, macOS 15.2, Windows 11 -->

### Documentation & Housekeeping
Expand All @@ -69,7 +73,13 @@ Fixes #
- [ ] No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
- [ ] I've tested the skill end-to-end: `hermes --toolsets skills -q "Use the X skill to do Y"`

## Screenshots / Logs
## Verification Evidence

<!-- If applicable, add screenshots or log output showing the fix/feature in action. -->
<!-- Show your verification. Test output, before/after logs, screenshots from debug runs,
profiling traces — anything a reviewer can inspect without running your branch.
If tests produce output, paste it here. For performance changes, include timings. -->

<!-- Example: Before the fix, non-Bedrock provider listing emitted botocore timeout traces
for http://169.254.169.254. Targeted test run: 38 passed. Full suite: 19093 passed
(28 pre-existing failures listed below, none in touched files). -->

33 changes: 33 additions & 0 deletions gateway/platforms/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,25 @@ async def edit_message(
logger.error("[%s] Failed to edit Discord message %s: %s", self.name, message_id, e, exc_info=True)
return SendResult(success=False, error=str(e))

async def delete_message(
self,
chat_id: str,
message_id: str,
) -> bool:
"""Delete a Discord message by ID. Supports both channel and thread messages."""
if not self._client:
return False
try:
channel = self._client.get_channel(int(chat_id))
if not channel:
channel = await self._client.fetch_channel(int(chat_id))
msg = await channel.fetch_message(int(message_id))
await msg.delete()
return True
except Exception as e:
logger.debug("[%s] Failed to delete Discord message %s: %s", self.name, message_id, e)
return False

async def _send_file_attachment(
self,
chat_id: str,
Expand Down Expand Up @@ -2699,6 +2718,20 @@ async def slash_queue(interaction: discord.Interaction, prompt: str):
async def slash_background(interaction: discord.Interaction, prompt: str):
await self._run_simple_slash(interaction, f"/background {prompt}", "Background task started~")

# ── /raw: inline handler (gateway-level, does NOT go to agent) ──
@tree.command(
name="raw",
description="Save a URL to Wiki Raw/ folder for nightly compilation",
)
@discord.app_commands.describe(url="X/Twitter link or any URL to ingest")
async def slash_raw(interaction: discord.Interaction, url: str):
"""Delegates to gateway _handle_raw_command for proper scraping + formatting."""
# Strip command prefix if user pasted "/raw https://..." into the url field
url = url.strip()
if url.startswith("/raw ") or url.startswith("!raw "):
url = url.split(" ", 1)[1].strip()
await self._run_simple_slash(interaction, f"/raw {url}")

# ── Auto-register any gateway-available commands not yet on the tree ──
# This ensures new commands added to COMMAND_REGISTRY in
# hermes_cli/commands.py automatically appear as Discord slash
Expand Down
Loading
Loading