prepare("SELECT setting_value FROM bot_settings WHERE setting_key = ?"); $stmt->execute([$key]); return $stmt->fetchColumn() ?: ''; } function save_setting($key, $value) { $stmt = db()->prepare("UPDATE bot_settings SET setting_value = ? WHERE setting_key = ?"); $stmt->execute([$value, $key]); } $message = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $token = $_POST['discord_token'] ?? ''; $guild = $_POST['guild_id'] ?? ''; $channel = $_POST['voice_channel_id'] ?? ''; $alarm = $_POST['alarm_time'] ?? ''; save_setting('discord_token', $token); save_setting('guild_id', $guild); save_setting('voice_channel_id', $channel); save_setting('alarm_time', $alarm); // Also update JSON for the bot $config = [ 'discord_token' => $token, 'guild_id' => $guild, 'voice_channel_id' => $channel, 'alarm_time' => $alarm, 'last_voice_channel' => json_decode(get_setting('last_voice_channel'), true) ?: null ]; if (!is_dir(__DIR__ . '/data')) mkdir(__DIR__ . '/data', 0775, true); file_put_contents(__DIR__ . '/data/config.json', json_encode($config, JSON_PRETTY_PRINT)); $message = 'Configuration saved successfully!'; } $token = get_setting('discord_token'); $guildId = get_setting('guild_id'); $voiceId = get_setting('voice_channel_id'); $alarmTime = get_setting('alarm_time'); ?> Discord Alarm Sahur — Dashboard

Alarm Sahur Bot

Configuration
Obtained from Discord Developer Portal.
Bot will automatically join the voice channel and play audio at this time.
Audio Asset Manage
sahur.mp3
File located at assets/audio/sahur.mp3.
Quick Start
  1. Configure the Token and Channel IDs above.
  2. Ensure node_modules are installed (run npm install).
  3. Start the bot via node index.js.
  4. Use /testsahur in your Discord server.