> For the complete documentation index, see [llms.txt](https://ak-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ak-scripts.gitbook.io/docs/yi-lai/markdown/ti-huan-kuang-jia-mo-ren-zhi/ox/tong-zhi-notify.md).

# 通知（Notify）

### ⚙️ 如何更改 ox\_lib 的默认通知 <a href="#ru-he-geng-gai-esx-de-mo-ren-tong-zhi" id="ru-he-geng-gai-esx-de-mo-ren-tong-zhi"></a>

> 本节将教你如何将 `ox_lib` **默认通知** 替换为 `ak-lib` **通知**。
>
> 由于 `ox_lib` 不同版本在函数结构上略有差异，本次示例基于 `ox_lib` `3.31.4` 进行讲解

***

### 🧭 步骤一：打开通知脚本文件

导航到以下路径：

```
ox_lib/resource/interface/client/notify.lua
```

***

### 🧩 步骤二：替换 ox\_lib 整个通知函数内容

```lua
function lib.notify(data)
    local notifyType = data.type or data.status or "info"
    local title      = data.title
    local message    = data.description or data.message
    if title and not message then
        message = title
        title = nil
    end
    exports['ak-lib']:Notify({
        title    = title,
        message  = message or "",
        type     = notifyType,
    })
end

function lib.defaultNotify(data)
    local notifyType = data.type or data.status or "info"
    if notifyType == "inform" then notifyType = "info" end

    return lib.notify({
        title       = data.title,
        message     = data.description,
        type        = notifyType,
    })
end

RegisterNetEvent('ox_lib:notify', lib.notify)
RegisterNetEvent('ox_lib:defaultNotify', lib.defaultNotify)
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ak-scripts.gitbook.io/docs/yi-lai/markdown/ti-huan-kuang-jia-mo-ren-zhi/ox/tong-zhi-notify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
