forums¶
Forum views
Discord UI views used in forums.
- class byte_bot.byte.views.forums.HelpThreadView(author: Member, guild_id: int, bot: Bot, *args: list, **kwargs: dict)[source]¶
Bases:
View
View for the help thread.
Initialize the view.
- __init__(author: Member, guild_id: int, bot: Bot, *args: list, **kwargs: dict) None [source]¶
Initialize the view.
- async setup() None [source]¶
Asynchronously setup guild details and add button.
Todo
Think about this more - If we plan on decoupling this should be a call to an endpoint like we do in
byte.bot.Byte.on_guild_join
.
- async delete_interaction_check(interaction: Interaction) bool [source]¶
Check if the user is the author or an admin.
- Parameters:
interaction (Interaction) – Interaction object.
- Returns:
True if the user is the author or an admin, False otherwise.
- Return type:
- async solve_button_callback(interaction: Interaction, button: Button) None [source]¶
Mark the thread as solved.
- Parameters:
interaction – Interaction object.
button – Button object.
- async remove_button_callback(interaction: Interaction, button: Button) None [source]¶
Remove the view and embed.
- Parameters:
interaction – Interaction object.
button – Button object.