public async Task Handle(PlayerChatNotification notification, CancellationToken cancellationToken) { foreach (var plugin in _pluginLoader.Enabled) { try { await plugin.OnChatMessage(notification, _pluginContext); } catch (Exception ex) { await _mediator.Publish(new PluginLogNotification { Exception = ex, Message = $"Error in {nameof(plugin.OnChatMessage)} for plugin {plugin.Name}" }); } } }
public async Task Handle(PlayerChatNotification notification, CancellationToken cancellationToken) { await _wonderlandClient?.SendChatMessageAsync($"**<{notification.PlayerName.Trim()}>** {notification.Message.Trim()}"); }
public virtual Task OnChatMessage(PlayerChatNotification notification, IPluginContext context) { return(Task.CompletedTask); }