@helyx/module-suggestions
v1.1.15
Published
Configurable Discord suggestions and voting for Helyx.
Maintainers
Readme
Suggestions module
An official Helyx Community module for collecting public ideas with configurable reaction or button voting.
Discord flow
/suggestion configurelets an authorised server manager choose a text or announcement channel, attribution mode, voting state, voting style, positive and negative emojis, an optional voter role, and server guidance. Its default policy requiresMANAGE_GUILDand remains configurable through Helyx permissions./suggestion submitis available to server members by default. Before opening the modal, it states that the result is public, explains whether the display name will appear, discloses retained identity metadata, shows any server guidance, and warns against private information.- The modal collects a bounded title and explanation. Helyx normalises and revalidates both fields after submission, then posts the idea as a Components V2 card. User-authored details are rendered as plain text and Discord mentions are disabled by the bot adapter.
- Reaction mode automatically adds the configured positive and negative emoji. When a member selects one, Helyx removes their opposite reaction, so at most one remains. A configured voter role is enforced by removing ineligible reactions.
- Button mode presents positive and negative emoji-labelled buttons. A member's selection is stored conflict-safely and selecting the other button changes the active choice. Helyx acknowledges the interaction before database work, refreshes the public card with Supported and Oppose totals, and sends the member a private confirmation.
- Submission attempts are limited to three per member per hour. Button-vote attempts are limited to twenty per member per minute and reaction-vote events to thirty per member per minute. The public slash command also uses shared command middleware throttling.
If the Discord message is created but its required metadata cannot be stored, the module removes the message before reporting failure. It never reports a successful submission when the public post was rolled back.
Dashboard configuration
The manifest contributes eight generic Community settings:
- Suggestions channel
- Anonymous public posts
- Community voting
- Voting style: Discord reactions or Helyx buttons
- Positive vote emoji
- Negative vote emoji
- Optional required voter role
- Submission guidance
The dashboard renderer supplies real server channels and roles. The executable validator remains authoritative, uses the same keys and limits, validates Unicode/custom Discord emoji forms, and rejects identical vote emojis. The dashboard also exposes configurable permissions for /suggestion submit and /suggestion configure.
Stored data
suggestions_submissions stores a generated submission ID, Discord server, destination channel, Discord message, submitting account ID, public identity mode, the publicly posted title, details and attribution, and a snapshot of the voting style, emoji identifiers and voter-role rule. The public display content is retained only so a button vote can safely rebuild the Components V2 card with current totals. Keeping the voting snapshot means later configuration changes do not alter the rules of an existing suggestion. suggestions_votes stores button-mode choices only: a generated vote ID, Discord server, suggestion message, voting account ID, current positive/negative choice, and timestamps. Native reaction votes remain in Discord and are not duplicated in PostgreSQL.
Suggestion titles and details are never copied into operational logs or audit metadata. Public anonymity stores only the public “Suggested anonymously” attribution for card rebuilding; it does not remove the separately retained submitting account ID used for abuse handling. Configuration versions and metadata-only audit events are platform-owned.
When the optional Logging module is active, Suggestions contributes suggestion-submitted and suggestion-vote-changed customer activity events. Submission logging never copies the title or details. Vote-change logging is disabled by default because it can be noisy; server managers can opt in from the module's Logging tab.
Disabling or uninstalling the module does not automatically erase retained configuration or module records. Permanent deletion must remain an explicit server-owner operation when the platform data-deletion workflow is introduced.
Package and deployment boundaries
The module imports only approved Helyx contracts. It never imports Discord.js, a database driver, application-private code, or hosted-only infrastructure. SQL is confined to its reviewed migration, while runtime record operations use declared, allowlisted SDK collections. The same package is intended to run in hosted Helyx and future self-hosted compositions.
The package includes compiled output, its manifest, migrations, README, and proprietary notice in its npm allowlist. Publication is restricted to the repository's explicit release plan, clean-tree checks, tarball inspection, and registry verification.
Required bot access
Helyx needs VIEW_CHANNEL, SEND_MESSAGES, READ_MESSAGE_HISTORY, ADD_REACTIONS, and MANAGE_MESSAGES in the configured channel. MANAGE_MESSAGES is required by Discord to remove another member's opposite or ineligible reaction. Reaction mode uses the standard GUILD_MESSAGE_REACTIONS gateway intent; it is not a privileged intent. Custom emojis must be available to the bot in the configured server. If message creation, reaction setup, or required metadata persistence fails, the interaction rolls the public post back and does not claim success.
