star_toggle_ui

star_toggle_ui.check_and_mark_handled(interaction_id)[source]

Check if the interaction has already been handled, and mark it handled.

Return type:

bool

Returns:

True if already handled, False if this is the first time.

Parameters:

interaction_id (int)

class star_toggle_ui.StarToggleMenuView(channel_id, feature_states, *, timeout=60.0)[source]

Bases: View

The toggle menu showing all features with enabled/disabled status. # 💀🔥

NOT persistent — this is the popup that appears when ✧ is clicked. Timeout after 60s of inactivity.

Parameters:
class star_toggle_ui.StarToggleView(channel_id)[source]

Bases: View

Persistent view containing only the ✧ button. # 💀🔥

timeout=None makes this survive bot restarts when registered with client.add_view() in on_ready.

Parameters:

channel_id (str)

class star_toggle_ui.StarToggleButton(channel_id)[source]

Bases: StarToggleView

Grey ✧ button on every message — opens the toggle menu. # 🕷️💕

Parameters:

channel_id (str)

async callback(interaction)[source]

Open the toggle menu with current feature states. # 💀

Return type:

None

Parameters:

interaction (discord.Interaction)

star_toggle_ui.build_star_toggle_view(channel_id)[source]

Build a StarToggleView for attaching to outbound messages.

Returns None if discord is not importable (non-Discord platforms).

Return type:

StarToggleView | None

Parameters:

channel_id (str)