huruhuru - v0.0.2
    Preparing search index...

    Class SessionContext

    A thin wrapper that normalises common operations between interaction-based commands and message-based commands.

    Use this class when implementing commands to avoid branching on whether the caller is an interaction or a message.

    // Interaction
    const ctx = new CommandContext(interaction);
    await ctx.deferReply();
    await ctx.editReply("Done");

    // Message
    const ctx2 = new CommandContext(message);
    await ctx2.reply("Hello from message");

    Hierarchy (View Summary)

    Index
    • get options(): | Omit<
          CommandInteractionOptionResolver<CacheType>,
          "getMessage" | "getFocused",
      >
      | undefined

      Returns
          | Omit<
              CommandInteractionOptionResolver<CacheType>,
              "getMessage" | "getFocused",
          >
          | undefined

    • Parameters

      • Optionaloptions: InteractionDeferReplyOptions

      Returns Promise<InteractionResponse<boolean> | undefined>

    • Returns Promise<
          [
              PromiseSettledResult<void | undefined>,
              ...PromiseSettledResult<void | undefined>[],
          ],
      >

    • Parameters

      Returns Promise<Message<true>>

    • Parameters

      Returns Promise<Message<false>>

    • Parameters

      • this: CommandContext<Message<true>>
      • options: string | MessagePayload | MessageReplyOptions

      Returns Promise<OmitPartialGroupDMChannel<Message<true>>>

    • Parameters

      • this: CommandContext<Message<false>>
      • options: string | MessagePayload | MessageReplyOptions

      Returns Promise<OmitPartialGroupDMChannel<Message<false>>>

    • Parameters

      • this: CommandContext<Base>
      • options: string | MessagePayload | InteractionReplyOptions | MessageReplyOptions

      Returns Promise<Message<boolean>>