/// <summary> /// Получаем бота, а если он еще /// не инициализирован - инициализируем /// и возвращаем /// </summary> public static Api Get() { if (_bot != null) return _bot; _bot = new Api(Config.BotApiKey); _bot.SetWebhook(Config.WebHookUrl); return _bot; }
public static Api Get() { if (_bot != null) return _bot; _bot = new Api(Config.BotApiKey); _bot.SetWebhook(Config.WebHookUrl); if (Config.BotAdmins.Any()) StartedAtUtc = _bot.SendTextMessage(Config.BotAdmins.First(), "I'm initialized and ready for work!").Result.Date.ToUniversalTime(); return _bot; }