Skip to content
Open
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
17 changes: 11 additions & 6 deletions apps/discord_bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ Long-running service changes should be implemented as PR-based workflows rather
than direct production mutations. Task reads require an explicit project filter
to avoid guild-wide task enumeration.

Mention flow is opt-in per message: the bot runs the agent only when directly
mentioned in a server channel or thread. Mention-triggered agent results and
confirmation buttons are sent by DM to avoid leaking task or plan details into
public channels. A follow-up in the same thread should mention the bot again so
the bot has an explicit user trigger and fresh Discord role context for that
request.
Mention flow is opt-in per message: the bot runs the agent when directly
mentioned in a server channel or thread, or when a user sends the bot a DM.
DM requests are accepted only after resolving the sender as a current member of
the configured 508 Discord server. The `/agent` slash command is also registered
for bot DMs and uses the same configured-server membership and role resolution.
Other slash commands default to guild-only registration unless they are
explicitly reviewed and opted in to DM contexts.
Mention-triggered agent results and confirmation buttons are sent by DM to avoid
leaking task or plan details into public channels. A follow-up in the same
thread should mention the bot again so the bot has an explicit user trigger and
fresh Discord role context for that request.

Production mention handling depends on Discord gateway and channel access:
The bot requests all intents in code, but the production Discord application
Expand Down
14 changes: 13 additions & 1 deletion apps/discord_bot/src/five08/discord_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,19 @@ class Bot508(commands.Bot):
def __init__(self) -> None:
intents = discord.Intents.all()
# Use a prefix that won't accidentally trigger since we're using slash commands
super().__init__(command_prefix="$508$", intents=intents)
super().__init__(
command_prefix="$508$",
intents=intents,
allowed_contexts=discord.app_commands.AppCommandContext(
guild=True,
dm_channel=False,
private_channel=False,
),
allowed_installs=discord.app_commands.AppInstallationType(
guild=True,
user=False,
),
)
# Remove the default help command since we're using slash commands
self.remove_command("help")
self.http_server: Optional[BotHTTPServer] = None
Expand Down
Loading