public MainPage(FChatSharpHost program)
     : base("FChatSharpLib - Host - Main Menu", program,
            new Option("Join a channel", () => program.NavigateTo <JoinChannelPage>()),
            new Option("Leave a channel", () => program.NavigateTo <LeaveChannelPage>()),
            new Option($"Enable/Disable debug mode", () => program.NavigateTo <EnableDisableDebugMode>()))
 {
 }
        public override void Display()
        {
            base.Display();

            FChatSharpHost program = (FChatSharpHost)Program;

            var input = Input.ReadInt("Press 1 to Enable debug mode or 2 if you want to disable it:", 1, 2);

            program.Bot.Events.Debug = (input == 1);

            Output.WriteLine("Debug mode is now set to: " + program.Bot.Events.Debug.ToString());

            Input.ReadString("Press [Enter] to navigate home");
            Program.NavigateHome();
        }
        public override void Display()
        {
            base.Display();

            var input = Input.ReadString("Please enter the channel ID to join (ADH-0x0x0xx0x0x0x0x):");

            Output.WriteLine($"Joining channel {input}...");

            input = input.Trim().ToLower();
            if (!string.IsNullOrWhiteSpace(input))
            {
                FChatSharpHost program = (FChatSharpHost)Program;
                program.Bot.JoinChannel(input);
            }

            Input.ReadString("Press [Enter] to navigate home");
            Program.NavigateHome();
        }
Beispiel #4
0
        public override void Display()
        {
            base.Display();

            FChatSharpHost program = (FChatSharpHost)Program;

            var channels = program.Bot.State.Channels.ToList();

            for (int i = 0; i < channels.Count; i++)
            {
                Output.WriteLine($"#{i+1}: {channels[i]}");
            }
            var input = Input.ReadInt("Please enter the channel # to leave:", 1, channels.Count);

            Output.WriteLine($"Leaving channel {channels[input-1]}...");

            program.Bot.LeaveChannel(channels[input - 1]);

            Input.ReadString("Press [Enter] to navigate home");
            Program.NavigateHome();
        }
 public EnableDisableDebugMode(FChatSharpHost program)
     : base("Enable/Disable debug mode", program)
 {
 }
Beispiel #6
0
 static void Main(string[] args)
 {
     var bot = new FChatSharpHost("username", "password", "BotCharacterName", "ASuperDeveloper", true, 4000);
 }
 public JoinChannelPage(FChatSharpHost program)
     : base("Join a channel", program)
 {
 }
Beispiel #8
0
 public LeaveChannelPage(FChatSharpHost program)
     : base("Leave a channel", program)
 {
 }