English | 简体中文
UpdateUtil checks GitHub Releases for a newer version and outputs a notice in the BepInEx console.
ℹ️ This is a C#-only API.
using Bark.Tool;
// Call at the end of Plugin.Awake()
UpdateUtil.Check(
"CNCUMC/Bark", // GitHub repo, format "user/repo"
"Bark", // Mod display name (used in logs)
"2.0.0", // Current version
Logger // BepInEx ManualLogSource
);- Sends GET to
https://api.github.com/repos/{repo}/releases/latest - Compares
tag_nameagainst current version (semver comparison, strips leadingv) - Only alerts when latest > current
- Logs a warning on network/parse errors, does not affect gameplay
[Info :Bark] Bark is up to date (2.0.0)
[Warning:Bark] Bark update available! 1.1.1 -> 2.0.0
[Warning:Bark] Bark unable to check for updates