コード例 #1
0
            public TestBotManager()
            {
                ApiClient = DummyFactory.CreateDummyApiClient();
                var botModule = new ChoiceBotMain.ChoiceBot(ApiClient);

                Manager = new BotManager(ApiClient);
                Manager.AddBot(botModule);
            }
コード例 #2
0
        public static BotManager CreateDummyChoiceBot()
        {
            var apiClient  = CreateDummyApiClient();
            var botManager = new BotManager(apiClient);

            botManager.AddBot(new ChoiceBotMain.ChoiceBot(apiClient));

            return(botManager);
        }
コード例 #3
0
        private static async Task Start(MastodonClient mastoClient)
        {
            var client = mastoClient.ToCommon();

            var botManager = new BotManager(client);

            botManager.AddBot(new ChoiceBotMain.ChoiceBot(client));

            Console.WriteLine("choicebot running...");
            await botManager.Start();
        }
コード例 #4
0
        public Bot AddBot(BotConfig config)
        {
            var index = Manager.BotConfigs.FindIndex(z => z.Name == config.Name || z.Arguments == config.Arguments);

            if (index >= 0)
            {
                const string line1 = "Device with similar details has already been added.";
                const string line2 = "Please double check the entered configuration.";
                WinFormsUtil.Alert(line1, line2);
                return(Manager[index]);
            }
            var bot = Manager.AddBot(config);

            LB_Bots.Items.Add(new ListBoxExItem(bot, LB_Bots.Items.Count));
            return(bot);
        }