Created At: 2026-11-19T17:11:40Z Completed At: 2026-11-19T17:11:40Z Command exited with code 0. Command output: 262: fun toggleModule(botId: Long, moduleName: String, isEnabled: Boolean) { 263- viewModelScope.launch { 264- val bots = botsList.first().map { bot -> 265- if (bot.id == botId) { 266- val cfg = bot.modulesConfig 267- val updatedModules = when (moduleName.lowercase()) { 268- "welcome" -> cfg.copy(welcome = cfg.welcome.copy(isEnabled = isEnabled)) 269- "broadcast" -> cfg.copy(broadcast = cfg.broadcast.copy(isEnabled = isEnabled)) 270- "force_join", "forcejoin" -> cfg.copy(forceJoin = cfg.forceJoin.copy(isEnabled = isEnabled)) 271- "logs" -> cfg.copy(logs = cfg.logs.copy(isEnabled = isEnabled)) 272- else -> cfg 273- } 274- val newActivity = BotActivityItem( 275- id = System.currentTimeMillis().toString(), 276- timestamp = System.currentTimeMillis(), 277- type = "MODULE", 278- description = "Module '$moduleName' ${if (isEnabled) "enabled" else "disabled"}" 279- ) 280- bot.copy( 281- modulesConfig = updatedModules, 282- recentActivities = listOf(newActivity) + bot.recentActivities.take(15) 283- ) 284- } else bot 285- } 286- savePreference(stringPreferencesKey(PrefsConstants.TG_BOTS_JSON), jsonHelper.encodeToString(bots)) 287- }