private async Task OnChatStarting(dynamic dyn) { //Init Antiflood ChatInitContext chatInitCtx = new ChatInitContext(_messagesSource); await _chatEventHandler?.RunEventHandler(eh => eh.OnInit(chatInitCtx), ex => { _log.Log(LogLevel.Warn, _logCategory, $"Failed when [chatService] try to load chatEventHandler", new {}); }); }
public async Task OnInit(ChatInitContext ctx) { SpamHandler(ctx.Messages); await Task.CompletedTask; }