Skip to content

Commit

Permalink
feat: remove nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
JayXTQ committed Dec 10, 2024
1 parent 05a3b58 commit 5f5da5b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions DiscordLab.Bot/API/Modules/UpdateStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,17 @@ public static async Task GetStatus()
if(plugin.Name == Plugin.Instance.Name) status = statuses.First(x => x.ModuleName == "DiscordLab.Bot");
else continue;
}
if (status.Version > plugin.Version)

if (status.Version <= plugin.Version) continue;
if (Plugin.Instance.Config.AutoUpdate)
{
if (Plugin.Instance.Config.AutoUpdate)
{
restartServer = true;
byte[] pluginData = await Client.GetByteArrayAsync(status.Url);
WritePlugin(pluginData, status.ModuleName);
}
else
{
Log.Warn($"There is a new version of {status.ModuleName} available, version {status.Version}, you are currently on {plugin.Version}! Download it from {status.Url}");
}
restartServer = true;
byte[] pluginData = await Client.GetByteArrayAsync(status.Url);
WritePlugin(pluginData, status.ModuleName);
}
else
{
Log.Warn($"There is a new version of {status.ModuleName} available, version {status.Version}, you are currently on {plugin.Version}! Download it from {status.Url}");
}
}

Expand Down

0 comments on commit 5f5da5b

Please sign in to comment.