Skip to content
Typegatewayv0.9.0

KindName

type KindName<Ctx> = Ctx extends Ungateable
    ? "autocomplete"
    : Ctx extends InteractionGateContext<infer R>
      ? Repliables extends R
          ? "generic interaction"
          : R extends ChatInputCommandInteraction
            ? "Slash"
            : R extends MessageContextMenuCommandInteraction
              ? "MessageContextMenu"
              : R extends UserContextMenuCommandInteraction
                ? "UserContextMenu"
                : R extends StringSelectMenuInteraction
                  ? "StringMenu"
                  : R extends UserSelectMenuInteraction
                    ? "UserMenu"
                    : R extends RoleSelectMenuInteraction
                      ? "RoleMenu"
                      : R extends ChannelSelectMenuInteraction
                        ? "ChannelMenu"
                        : R extends MentionableSelectMenuInteraction
                          ? "MentionableMenu"
                          : R extends ButtonInteraction
                            ? "Button"
                            : R extends ModalSubmitInteraction
                              ? "Modal"
                              : "generic interaction"
      : Ctx extends EventGateContext<infer N>
        ? `${N & string} event`
        : Ctx extends AppPermissionsContext
          ? "generic interaction"
          : "any";

Ctx

Ctx