Added an periodical backup to the telegram bot

This commit is contained in:
Mac135135
2024-09-28 19:17:12 +03:00
parent e8d04644f8
commit 27d7a6a8cb
3 changed files with 1 additions and 3 deletions

View File

@@ -43,7 +43,6 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
private val connectivityManager = context.connectivityManager
private val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
var telegramChatId: String?
get() = preferences.getString("telegram_chat_id", null)
set(value) {

View File

@@ -52,7 +52,6 @@ class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodi
openTelegramBot("kotatsu_backup_bot")
true
}
// Кнопка для проверки работы API
val checkApiButton = Preference(requireContext()).apply {
key = "check_api_working"
title = "Проверить работу API"
@@ -102,7 +101,6 @@ class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodi
telegramIntent.setPackage("org.telegram.messenger")
startActivity(telegramIntent)
} catch (e: Exception) {
// Если Telegram не установлен, открываем через браузер
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/$botUsername"))
startActivity(browserIntent)
}

View File

@@ -151,3 +151,4 @@ class PeriodicalBackupWorker @AssistedInject constructor(
const val DATA_TIMESTAMP = "ts"
}
}