Core features

This document provides a deep-dive into the architectural mechanics of Inco's core Q&A engine.

1. Direct-to-DM Message Delivery

Unlike traditional bots that post anonymous questions into public channels where they get lost in chat noise, Inco sends every anonymous question directly to the recipient's Discord Direct Messages (DMs).

Fallback Gateway for Error 50007 (discord.Forbidden):

If a recipient has server DMs turned off or does not share a mutual server with Inco:

  1. The Discord API returns discord.Forbidden (Error code 50007: Cannot send messages to this user).
  2. Inco automatically catches this exception.
  3. An ephemeral prompt is returned to the sender with the Mutual Hub Invite Link (discord.gg/PkFXp468bV), explaining that the recipient needs to enable DMs or join the Mutual Hub to bridge communication.

2. Two-Way Anonymous Dialogue

Inco pioneers a unique Two-Way Reply System:

  • The recipient can click the persistent Reply Anonymously button on any received question embed.
  • A Discord Modal appears allowing them to write a reply (5 – 500 characters).
  • The reply is delivered to the original sender's DM, quoting the original question for context.
  • Neither user learns the identity or Discord tag of the other party.

3. Silent Shadow Blocking

Safety and harassment prevention are paramount in anonymous platforms:

  • Recipients can click Block Sender on any message.
  • The sender's snowflake ID is securely stored in blocked_relations mapped to the recipient.
  • The sender is NOT notified that they were blocked.
  • If the blocked user attempts to send another question, the bot returns a mock success message (Message Delivered!), but drops the message internally without delivering it.
  • This prevents abusers from knowing they have been filtered and prevents retaliation or account switching.

4. Presence-Aware 3-Hour Buffer & Pause/Resume Engine

For Free Tier users, question boxes are designed with an intelligent engagement cycle:

Architectural Details:

  1. Standby State: When /inbox open is executed, remaining_seconds is set to 10,800, is_paused = 0, and has_received_first_msg = 0. The timer does not deduct any seconds until a question arrives.
  2. First Question Arrival: As soon as a question is delivered, has_received_first_msg is toggled to 1. The bot checks the recipient's presence immediately:
    • If the recipient's Custom Status contains the promo keyword (e.g. inco), the timer is immediately marked Paused (is_paused = 1).
    • If no promo keyword is detected, the timer starts counting down from 10,800 seconds.
  3. Reactive Gateway Updates (on_presence_update):
    • Whenever Discord emits a presence event for the user, Inco inspects activities in real-time.
    • Adding the promo keyword pauses the timer instantly.
    • Removing the promo keyword resumes countdown from the exact remaining seconds.
  4. Periodic Watcher Task (inbox_watcher_task):
    • Runs every 60 seconds to tick active countdowns and automatically send an expiry notification DM when time reaches 0.
  5. Administrative Buffer Adjustments (/inbox adjust_time):
    • Bot owners can manually add, subtract, or set custom status buffer time for any user.
    • Accepts username, @mention, or User ID with real-time autocomplete suggestions (matching /ask behavior) and optional DM notifications.

5. Security & Content Sanitization

  • URL & Invite Filtering: Questions containing http://, https://, discord.gg/, or discord.com/invite/ are automatically rejected before dispatch.
  • Debouncing: Persistent buttons feature a 2.0-second debounce per user/message to prevent click spamming and duplicate modals.
  • Rate Limiting: Dispatches enforce a strict 60-second cooldown per sender.