discord-interactions.py

create_context

Function

Creates a SlashContext (internal use or tests).

from discord_interactions.slash import create_context

Signature

def create_context(    interaction: discord.Interaction,    command: SlashCommand | None = None,    options: Dict[str, Any] | None = None,) -> SlashContext

Parameters

NameTypeDefaultDescription
interactiondiscord.Interactionrequired
commandSlashCommand | NoneNone
optionsDict[str, Any] | NoneNone

Returns

SlashContext

Type a name: create_button, ModalBuilder, cooldown.