mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Misc
This commit is contained in:
parent
643b8a60fc
commit
14efac34aa
2 changed files with 19 additions and 19 deletions
File diff suppressed because one or more lines are too long
|
@ -453,21 +453,6 @@ public static class PluginsCore {
|
|||
}
|
||||
}
|
||||
|
||||
internal static async Task OnSelfPersonaState(Bot bot, SteamFriends.PersonaStateCallback data, string? nickname, string? avatarHash) {
|
||||
ArgumentNullException.ThrowIfNull(bot);
|
||||
ArgumentNullException.ThrowIfNull(data);
|
||||
|
||||
if ((ActivePlugins == null) || (ActivePlugins.Count == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await Utilities.InParallel(ActivePlugins.OfType<IBotIdentity>().Select(plugin => plugin.OnSelfPersonaState(bot, data, nickname, avatarHash))).ConfigureAwait(false);
|
||||
} catch (Exception e) {
|
||||
ASF.ArchiLogger.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task<string?> OnBotMessage(Bot bot, ulong steamID, string message) {
|
||||
ArgumentNullException.ThrowIfNull(bot);
|
||||
|
||||
|
@ -623,6 +608,21 @@ public static class PluginsCore {
|
|||
}
|
||||
}
|
||||
|
||||
internal static async Task OnSelfPersonaState(Bot bot, SteamFriends.PersonaStateCallback data, string? nickname, string? avatarHash) {
|
||||
ArgumentNullException.ThrowIfNull(bot);
|
||||
ArgumentNullException.ThrowIfNull(data);
|
||||
|
||||
if ((ActivePlugins == null) || (ActivePlugins.Count == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await Utilities.InParallel(ActivePlugins.OfType<IBotIdentity>().Select(plugin => plugin.OnSelfPersonaState(bot, data, nickname, avatarHash))).ConfigureAwait(false);
|
||||
} catch (Exception e) {
|
||||
ASF.ArchiLogger.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task OnUpdateFinished(Version newVersion) {
|
||||
ArgumentNullException.ThrowIfNull(newVersion);
|
||||
|
||||
|
|
Loading…
Reference in a new issue