public async Task Handle(PlayerAdvancementNotification notification, CancellationToken cancellationToken) { if (notification.IsChallenge) { await _wonderlandClient.SendMessageAsync($"**{notification.PlayerName}** has completed the challenge **{notification.Advancement}**"); } else { await _wonderlandClient.SendMessageAsync($"**{notification.PlayerName}** has made the advancement **{notification.Advancement}**"); } }
public async Task Handle(PlayerAdvancementNotification notification, CancellationToken cancellationToken) { foreach (var plugin in _pluginLoader.Enabled) { try { await plugin.OnPlayerAdvancement(notification, _pluginContext); } catch (Exception ex) { await _mediator.Publish(new PluginLogNotification { Exception = ex, Message = $"Error in {nameof(plugin.OnPlayerAdvancement)} for plugin {plugin.Name}" }); } } }
public virtual Task OnPlayerAdvancement(PlayerAdvancementNotification notification, IPluginContext context) { return(Task.CompletedTask); }