Skip to content
Closed
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
6 changes: 3 additions & 3 deletions hermes_cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,14 @@ def discord_skill_commands_by_category(
# commands per app.
_SLACK_MAX_SLASH_COMMANDS = 50
_SLACK_NAME_LIMIT = 32
_SLACK_INVALID_CHARS = re.compile(r"[^a-z0-9_\-]")
_SLACK_INVALID_CHARS = re.compile(r"[^a-z0-9_]")


def _sanitize_slack_name(raw: str) -> str:
"""Convert a command name to a valid Slack slash command name.

Slack allows lowercase a-z, digits, hyphens, and underscores. Max 32
chars. Uppercase is lowercased; invalid chars are stripped.
Slack allows lowercase a-z, digits, and underscores only (no hyphens).
Max 32 chars. Uppercase is lowercased; invalid chars are stripped.
"""
name = raw.lower()
name = _SLACK_INVALID_CHARS.sub("", name)
Expand Down
Loading