server-master/srcs/_plugins/WingsEmu.Plugins.DistributedGameEvents/BotMessages/BotMessageEventHandler.cs
2026-02-10 18:21:30 +01:00

25 lines
No EOL
768 B
C#

// WingsEmu
//
// Developed by NosWings Team
using System.Threading;
using System.Threading.Tasks;
using PhoenixLib.ServiceBus;
using WingsEmu.Game.Extensions;
using WingsEmu.Game.Managers;
using WingsEmu.Packets.Enums.Chat;
namespace WingsEmu.Plugins.DistributedGameEvents.BotMessages
{
public class BotMessageConsumer : IMessageConsumer<BotMessageMessage>
{
private readonly ISessionManager _sessionManager;
public BotMessageConsumer(ISessionManager sessionManager) => _sessionManager = sessionManager;
public async Task HandleAsync(BotMessageMessage e, CancellationToken cancellation)
{
await _sessionManager.BroadcastAsync(async x => x.GenerateMsgPacket(e.Message, MsgMessageType.Middle));
}
}
}