Ejemplo n.º 1
0
        private void OnJoinedChannel(object sender, OnJoinedChannelArgs e)
        {
            EvtJoinedChannelArgs jcArgs = new EvtJoinedChannelArgs()
            {
                BotUsername = e.BotUsername,
                Channel     = e.Channel
            };

            OnJoinedChannelEvent?.Invoke(jcArgs);
        }
        private void SetupStart()
        {
            EvtConnectedArgs conArgs = new EvtConnectedArgs
            {
                BotUsername     = BotProgram.BotName,
                AutoJoinChannel = string.Empty
            };

            OnConnectedEvent?.Invoke(conArgs);

            EvtJoinedChannelArgs joinedChannelArgs = new EvtJoinedChannelArgs
            {
                BotUsername = BotProgram.BotName,
                Channel     = string.Empty
            };

            OnJoinedChannelEvent?.Invoke(joinedChannelArgs);
        }
        private void SetupStart()
        {
            TRBotLogger.Logger.Information($"\nPlease enter a name to use (no spaces)! This can be an existing name in the database. Skip to use \"{DEFAULT_TERMINAL_USERNAME}\" as the name.");

            string newName = Console.ReadLine();

            Console.WriteLine();

            if (string.IsNullOrEmpty(newName) == true)
            {
                newName = DEFAULT_TERMINAL_USERNAME;
            }
            else
            {
                //Remove all spaces
                newName = Helpers.RemoveAllWhitespace(newName);
            }

            //Set the name
            TerminalUsername = newName;

            EvtConnectedArgs conArgs = new EvtConnectedArgs
            {
                BotUsername     = TerminalUsername,
                AutoJoinChannel = string.Empty
            };

            OnConnectedEvent?.Invoke(conArgs);

            EvtJoinedChannelArgs joinedChannelArgs = new EvtJoinedChannelArgs
            {
                BotUsername = TerminalUsername,
                Channel     = string.Empty
            };

            OnJoinedChannelEvent?.Invoke(joinedChannelArgs);
        }