Exemplo n.º 1
0
 /// <summary>
 /// Constructor for the Twitch_Helix api helper
 /// </summary>
 public HelixHelper(
     Config.IBotConfigContainer botConfigContainer,
     ICommunication communication)
 {
     this.communication = communication;
     botConfig          = botConfigContainer.BotConfig;
 }
Exemplo n.º 2
0
 public AuthCheckerMiddleware(
     RequestDelegate next,
     Config.IBotConfigContainer botConfigContainer,
     ICommunication communication)
 {
     _next              = next;
     botConfig          = botConfigContainer.BotConfig;
     this.communication = communication;
 }
Exemplo n.º 3
0
        public ChatLogger(
            Config.IBotConfigContainer botConfigContainer,
            ICommunication communication)
        {
            botConfig = botConfigContainer.BotConfig;

            lineChannel = Channel.CreateUnbounded <string>();
            chatLog     = new Lazy <Logs.LocalLogger>(() => new Logs.LocalLogger("ChatLogs", "chat"));

            communication.SendMessageHandlers   += WriteOutgoingMessage;
            communication.SendWhisperHandlers   += WriteOutgoingWhisper;
            communication.ReceiveMessageLoggers += WriteIncomingMessage;

            HandleLines();
        }
Exemplo n.º 4
0
        public BasicView(
            Config.IBotConfigContainer botConfigContainer,
            ICommunication communication,
            ApplicationManagement applicationManagement)
        {
            botConfig                  = botConfigContainer.BotConfig;
            this.communication         = communication;
            this.applicationManagement = applicationManagement;

            consoleChannel = Channel.CreateUnbounded <ConsoleKeyInfo>();

            LaunchListeners();

            communication.ReceivePendingNotificationHandlers += ReceivePendingNotification;
            communication.ReceiveEventHandlers  += ReceiveEventHandler;
            communication.ReceiveMessageLoggers += ReceiveMessageHandler;
            communication.SendMessageHandlers   += SendPublicChatHandler;
            communication.SendWhisperHandlers   += SendWhisperHandler;
            communication.DebugMessageHandlers  += DebugMessageHandler;
        }
        public IrcClient(
            Config.IBotConfigContainer botConfigContainer,
            IIRCLogger ircLogger,
            Chat.IChatMessageHandler chatMessageHandler,
            INoticeHandler noticeHandler,
            ICommunication communication,
            ErrorHandler errorHandler)
        {
            botConfig         = botConfigContainer.BotConfig;
            this.errorHandler = errorHandler;

            this.ircLogger          = ircLogger;
            this.chatMessageHandler = chatMessageHandler;
            this.noticeHandler      = noticeHandler;
            this.communication      = communication;

            username = botConfig.BotName.ToLower();
            channel  = botConfig.Broadcaster.ToLower();

            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentException("Bot Name cannot be empty.");
            }

            if (string.IsNullOrEmpty(channel))
            {
                throw new ArgumentException("Bot Channel cannot be empty.");
            }

            Channel <string> chatChannel = Channel.CreateUnbounded <string>();

            outgoingChatWriter = chatChannel.Writer;
            outgoingChatReader = chatChannel.Reader;

            exhaustiveLogging = botConfig.ExhaustiveIRCLogging;

            communication.SendMessageHandlers += SendMessage;
            communication.SendWhisperHandlers += SendWhisper;
        }