unit uRecords;

interface

type
  TEventGlobal = record
    Event: integer;
    Condition: string;
    Action: integer;
    Param: string;
  end;

type
  TBanWord = record
    regexp: string;
  end;

type
  TOBSNotify = record
    Picture: string;
    Sound: string;

    ColorBlock: string;
    SolidBorder: integer;
    Paddings: integer;
    ColorBorder: string;
    ColorBackground: string;

    HeaderText: string;
    HeaderColorFont: string;
    HeaderSizeFont: integer;
    HeaderStyleFont: string;

    MessText: string;
    MessColorFont: string;
    MessSizeFont: integer;
    MessStyleFont: string;

    TimeMess: integer;
    TypeEvent: integer;
    TypeEdit: string;
    port: integer;

  end;

type
  TOBSChat = record
    ColorBlock: string;
    ColorBorder: integer;
    ColorBackground: integer;
    ColorFont: integer;
    SolidBorder: integer;
    Paddings: integer;
    SizeFont: integer;
    MaxCountMess: integer;
    TimeMess: integer;
    port: integer;
    freez: integer;
    StyleFont: integer;
  end;

type
  TListCommands = record
    R1: string;
    R2: string;
  end;

type
  TCounter = record
    counterName: string;
    trigger: string;
    count: integer;
    auto: integer;
  end;

type
  TListTimer = record
    Enable: integer;
    interval: integer;
    o: integer;
    mess: string;
  end;

type
  TOBSKandinsky = record
    port: integer;
  end;

type
  TRandomCounters = record
    rndName: string;
    Ot: integer;
    ToValue: integer;
  end;

type
  TRLog = record
    rTime: ttime;
    rType: string;
    rModule: string;
    rMethod: string;
    rMessage: string;
  end;

type
  TConst = record
    GeneralPath: string;
    AppDataPath: string;
    DBPath: string;
    fontsPath: string;
    imgsPath: string;
    soundsPath: string;
    stlPath: string;
    ytSongsPath: string;
    SilentPlay: string;
    ytPlay: string;
    cfg1: string;
  end;

type
  TLogin = record
    TTV_Token_Bot: string;
    TTV_Token_Strimer: string;
    TTV_Name_Bot: string;
    TTV_Name_Strimer: string;
    TTV_ClientID: string;

    DA_ClientID: string;
    DA_Client_Sictert: string;
    DA_RedirectURL: string;
    DA_Code: string;

    AI_Gigachat_ClientID: string;
    AI_Gigachat_AutorizationCode: string;
    AI_ChatGPT_Token: string;
    AI_DeepSeek_Token: string;
  end;

var
  RLogin: TLogin;

type
  TUser = record
    id: string;
    login: string;
    DisplayName: string;
    created_at: TDateTime;
    follow_at: TDateTime;
    isVip: boolean;
    isModer: boolean;
    isO: boolean;
    isO_today: boolean;
  end;

  TImage = record
    Url1x: string;
    Url2x: string;
    Url4x: string;
  end;

  { TReward = record
    Id: string;
    ChannelId: string;
    Title: string;
    Prompt: string;
    Cost: Integer;
    IsUserInputRequired: Boolean;
    IsSubOnly: Boolean;
    Image: TImage;
    DefaultImage: TImage;
    BackgroundColor: string;
    IsEnabled: Boolean;
    IsPaused: Boolean;
    IsInStock: Boolean;
    MaxPerStream: record
    IsEnabled: Boolean;
    MaxPerStream: Integer;
    end;
    ShouldRedemptionsSkipRequestQueue: Boolean;
    end; }

  { TRedemption = record
    Id: string;
    User: TUser;
    ChannelId: string;
    RedeemedAt: string;
    Reward: TReward;
    UserInput: string;
    Status: string;
    end; }

  { TData = record
    Timestamp: string;
    Topic: string; // Добавлено поле Topic
    MessageType: string; // Добавлено поле MessageType
    Redemption: TRedemption;
    end; }

  { TRewardRedeemed = record
    &Type: string;
    Data: TData;
    end; }

type
  TCustomRevards = record
    id: string;
    title: string;
    promt: string;
    cost: integer;
    is_user_input_required: boolean;
  end;

  { type
    THistRevards = record
    revard: TRewardRedeemed;
    user: user;
    is_ok: boolean;
    end; }

type
  TTwitchChatMessage = record
    BadgeInfo: string;
    Badges: string;
    ClientNonce: string;
    Color: string;
    DisplayName: string;
    Emotes: string;
    FirstMsg: integer;
    Flags: string;
    id: string;
    Moder: integer;
    ReturningChatter: integer;
    RoomId: string;
    Subscriber: integer;
    TmiSentTs: Int64;
    Turbo: integer;
    UserId: string;
    UserType: string;
    Vip: integer;
    Username: string;
    Channel: string;
    Message: string;
  end;

type
  TBadgeVersion = record
    id: string;
    ImageUrl1x: string;
    ImageUrl2x: string;
    ImageUrl4x: string;
    title: string;
    Description: string;
    ClickAction: string;
    ClickUrl: string;
  end;

  TChatBadge = record
    SetId: string;
    Versions: TArray<TBadgeVersion>;
  end;

  TEmotes = record
    id: string;
    name: string;
    images: TImage;
    tier: string;
    emote_type: string;
    emote_set_id: string;
    format: TArray<string>;
    scale: TArray<string>;
    theme_mode: TArray<string>;
    topImage: string;
  end;

  TStyleChat = record
    Nick: string;
    Context: string;
    MaxMsgCount: integer;
    TimeMsg: integer;
    FontSize: integer;
    FontFamily: string;
    FontColor: string;
    BorderColor: string;
    BColor: string;
    BorderSize: integer;
    BlockColor: string;
    BlockPadding: integer;
  end;

  TFont = record
    Font: string;
    Size: integer;
    Color: string;
  end;

  TStyleEvent = record
    title: string;
    Context: string;
    Url: string;
    SoundURL: string;
    RequireInteraction: boolean;

    Timestamp: TDateTime;
    TimeMsg: integer;

    FontTitle: TFont;
    FontContext: TFont;

    BorderColor: string;
    BorderSize: integer;
    BlockColor: string;

  end;

type
  TBTTVr = record
    id: string;
    code: string;
  end;

type
  T7TVr = record
    id: string;
    code: string;
    Url: string;
  end;

  TCondition = record
    broadcaster_user_id: string;
    reward_id: string;
  end;

  TTransport = record
    method: string;
  end;

  TSubscriptionPoints = record
    id: string;
    subscription_type: string;
    // "type" зарезервировано в Delphi, поэтому используем другое имя
    version: string;
    status: string;
    cost: integer;
    Condition: TCondition;
    transport: TTransport;
    created_at: string;
  end;

  TMaxPerStream = record
    is_enabled: boolean;
    value: integer;
  end;

  TMaxPerUserPerStream = record
    is_enabled: boolean;
    value: integer;
  end;

  TGlobalCooldown = record
    is_enabled: boolean;
    seconds: integer;
  end;

  TReward = record
    id: string;
    title: string;
    cost: integer;
    prompt: string;
  end;

  TEventReward = record
    id: string;
    broadcaster_user_id: string;
    broadcaster_user_login: string;
    broadcaster_user_name: string;
    user_id: string;
    user_login: string;
    user_name: string;
    user_input: string;
    revard: TReward;
  end;

  TCustomRewardEvent = record
    subscription: TSubscriptionPoints;
    Event: TEventReward;
  end;

  TMetadata = record
    message_id: string;
    message_type: string;
    message_timestamp: string;
    subscription_type: string;
  end;

  TSession = record
    id: string;
    status: string;
    connected_at: string;
    keepalive_timeout_seconds: integer;
    reconnect_url: string;
  end;

  TPayload = record
    session: TSession;
  end;

  TWelcomMessage = record
    payload: TPayload;
  end;

  TEventFollow = record
    user_id: string;
    user_login: string;
    user_name: string;
    broadcaster_user_id: string;
    broadcaster_user_login: string;
    broadcaster_user_name: string;
    followed_at: string;
  end;

  TEventSub = record
    user_id: string;
    user_login: string;
    user_name: string;
    broadcaster_user_id: string;
    broadcaster_user_login: string;
    broadcaster_user_name: string;
    tier: string;
    is_gift: boolean;
  end;

  TEventGift = record
    user_id: string;
    user_login: string;
    user_name: string;
    broadcaster_user_id: string;
    broadcaster_user_login: string;
    broadcaster_user_name: string;
    total: integer;
    tier: string;
    cumulative_total: integer; // null if anonymous or not shared by the user
    is_anonymous: boolean;
  end;

  TEventRaid = record
    from_broadcaster_user_id: string;
    from_broadcaster_user_login: string;
    from_broadcaster_user_name: string;
    to_broadcaster_user_id: string;
    to_broadcaster_user_login: string;
    to_broadcaster_user_name: string;
    viewers: integer;
  end;

  TFollowEvent = record
    subscription: TSubscriptionPoints;
    Event: TEventFollow;
  end;

  TSubEvent = record
    subscription: TSubscriptionPoints;
    Event: TEventSub;
  end;

  TGiftEvent = record
    subscription: TSubscriptionPoints;
    Event: TEventGift;
  end;

  TRaidEvent = record
    subscription: TSubscriptionPoints;
    Event: TEventRaid;
  end;

  TBotAppCfg = record
    TTV_ClientID: string;
    AI_GigaChat_AC: string;
    AI_Gigachat_ClientID: string;
    AI_ChatGPT_Token: string;
    AI_DeepSeec_Token: string;
    DA_ClientID: string;
    DA_Sicret: string;
    DA_URL: string;
  end;

implementation

end.
