blackcat.js-discord - v1.0.17
    Preparing search index...

    Type Alias CooldownCommandContext

    CooldownCommandContext:
        | {
            client: Client<boolean>;
            commandName: string;
            guildId: string | null;
            member: GuildMember | null;
            type: "interaction";
            userId: string;
        }
        | {
            client: Client<boolean>;
            commandName: string;
            guildId: string | null;
            member: GuildMember | null;
            type: "message";
            userId: string;
        }

    CooldownCommandContext

    Abstract layer để CooldownManager không phụ thuộc trực tiếp vào Interaction hoặc Message.

    Dùng cho:

    • Slash Command (interactionCreate)
    • Prefix Command (messageCreate)

    Type Declaration

    • {
          client: Client<boolean>;
          commandName: string;
          guildId: string | null;
          member: GuildMember | null;
          type: "interaction";
          userId: string;
      }
      • client: Client<boolean>

        Discord Client.

      • commandName: string

        Tên lệnh đang sử dụng

      • guildId: string | null

        ID của guild (null nếu DM)

      • member: GuildMember | null

        GuildMember object Dùng để:

        • lấy role
        • kiểm tra permission
      • type: "interaction"

        Context từ slash command

      • userId: string

        ID của user thực thi command

    • {
          client: Client<boolean>;
          commandName: string;
          guildId: string | null;
          member: GuildMember | null;
          type: "message";
          userId: string;
      }
      • client: Client<boolean>

        Discord Client.

      • commandName: string

        Tên lệnh đang sử dụng

      • guildId: string | null

        ID guild

      • member: GuildMember | null

        Member tương ứng

      • type: "message"

        Context từ message command (prefix)

      • userId: string

        ID của user gửi message