/// <summary> /// Returns the instance of TelegramBotController /// </summary> /// <param name="mainWindow">MainWindow needed to call methods defined in it.</param> /// <param name="botId">Bot ID needed to start bot</param> /// <param name="username">Username needed to start bot</param> /// <returns></returns> public static TelegramBotController GetInstance(MainWindow mainWindow, string botId, string username) { if (Controller == null) { Controller = new TelegramBotController(mainWindow, botId, username); } return(Controller); }
/// <summary> /// Resets the Controller /// </summary> public static void ResetController() { Controller = null; }
/// <summary> /// Easy way to get telegram bot controller cnstance /// </summary> /// <returns></returns> private TelegramBotController GetTelegramBotControllerInstance() { return(TelegramBotController.GetInstance(MainWindow, BotId, Username)); }
/// <summary> /// Resets all controller to get a clean restart /// </summary> public static void ResetController() { CmdController.ResetController(); TelegramBotController.ResetController(); Controller = null; }