This Discord bot monitors specified voice channels and sends notifications when users join, leave, or switch between them. It also includes an AFK mode feature that automatically responds to users who join your voice channel while you're away.
- π Voice Channel Monitoring: Get notified when users join, leave, or switch between specified voice channels
- π± Multiple Notification Methods: Receive notifications via Discord DMs and ntfy.sh
- π« AFK Mode: Automatically respond to users who join your voice channel while you're away
- π Return Notifications: Automatically notifies users who joined while you were AFK when you return
- π Status Command: Check current bot settings including AFK status, notification channels, and active users
- βοΈ Customizable Settings: Set custom AFK messages and notification channels
- Node.js (v16.9.0 or higher)
- A Discord account and a Discord bot token
- A Discord server where you have permission to add bots
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Navigate to the "Bot" tab and click "Add Bot"
- Under the "Privileged Gateway Intents" section, enable:
- Server Members Intent
- Message Content Intent
- Copy your bot token (you'll need this later)
- Go to the "OAuth2" > "URL Generator" tab
- Select the following scopes:
botapplications.commands
- Select the following bot permissions:
- Read Messages/View Channels
- Send Messages
- Read Message History
- Connect to Voice
- Copy the generated URL and open it in your browser to invite the bot to your server
- Clone or download this repository
- Install dependencies:
npm install
- Create a
.envfile in the project root with the following variables:
# Discord Configuration
DISCORD_TOKEN=your_discord_bot_token
DISCORD_USER_ID=your_discord_user_id
TARGET_VOICE_CHANNEL1_ID=first_voice_channel_id_to_monitor
TARGET_VOICE_CHANNEL2_ID=second_voice_channel_id_to_monitor
...
NOTIFICATION_CHANNEL_ID=channel_id_for_afk_notifications
# NTFY Configuration
NTFY_TOPIC=your_ntfy_topic_name
To find the IDs you need:
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click on a voice channel and select "Copy ID" to get the voice channel ID
- Right-click on your username and select "Copy ID" to get your user ID
- Right-click on a text channel and select "Copy ID" to get the notification channel ID
- Choose a unique topic name for your notifications
- Add this topic name to your
.envfile asNTFY_TOPIC - Install the ntfy app on your mobile device
- Subscribe to your topic in the app
node index.jsUse the /afk command to manage AFK mode:
/afk action:on- Enable AFK mode with the default message/afk action:on message:Your custom message- Enable AFK mode with a custom message/afk action:on channel:#channel-name- Enable AFK mode and set a specific notification channel/afk action:off- Disable AFK mode
The bot will automatically send notifications when:
- A user joins one of the monitored voice channels
- A user switches between monitored voice channels
- A user leaves a monitored voice channel
Notifications will be sent to:
- Your Discord DMs
- Your ntfy topic (which you can receive on mobile)
When AFK mode is enabled, the bot will also send a message in the specified text channel to notify users who join your voice channel that you're away.
Use the /status command to check the current bot configuration:
- Shows whether AFK mode is enabled or disabled
- Displays the current notification channel
- Shows your current AFK message
- Lists all monitored voice channels
- When AFK mode is active, shows users who joined during your absence
You can modify the following aspects of the bot:
- Add more voice channels to monitor by adding them to the
.envfile - Change the notification format by editing the embed creation in the code
- Customize the AFK message using the
/afkcommand
- If the bot doesn't respond to commands, make sure you've enabled the correct intents in the Discord Developer Portal
- If you're not receiving notifications, check that your user ID is correctly set in the
.envfile - For ntfy issues, verify your topic name and check that you're subscribed to it in the app
This project is open source and available for anyone to use and modify.
μ΄ λμ€μ½λ λ΄μ μ§μ λ μμ± μ±λμ λͺ¨λν°λ§νκ³ μ¬μ©μκ° μ μ₯, ν΄μ₯ λλ μ±λ κ° μ΄λν λ μλ¦Όμ 보λ λλ€. λν μ리λ₯Ό λΉμΈ λ μμ± μ±λμ μ μ₯νλ μ¬μ©μμκ² μλμΌλ‘ μλ΅νλ AFK λͺ¨λ κΈ°λ₯λ ν¬ν¨λμ΄ μμ΅λλ€.
- π μμ± μ±λ λͺ¨λν°λ§: μ¬μ©μκ° μ§μ λ μμ± μ±λμ μ μ₯, ν΄μ₯ λλ μ΄λν λ μλ¦Ό λ°κΈ°
- π± λ€μν μλ¦Ό λ°©λ²: Discord DMκ³Ό ntfy.shλ₯Ό ν΅ν΄ μλ¦Ό λ°κΈ°
- π« AFK λͺ¨λ: μ리λ₯Ό λΉμΈ λ μμ± μ±λμ μ μ₯νλ μ¬μ©μμκ² μλμΌλ‘ μλ΅
- π λ³΅κ· μλ¦Ό: AFK μνμμ λμμμ λ κ·Έλμ μ μ₯ν μ¬μ©μλ€μκ² μλμΌλ‘ μλ¦Ό
- π μν νμΈ λͺ λ Ήμ΄: AFK μν, μλ¦Ό μ±λ, νμ± μ¬μ©μ λ± νμ¬ λ΄ μ€μ νμΈ
- βοΈ λ§μΆ€ μ€μ : μ¬μ©μ μ μ AFK λ©μμ§ λ° μλ¦Ό μ±λ μ€μ
- Node.js (v16.9.0 μ΄μ)
- Discord κ³μ λ° Discord λ΄ ν ν°
- λ΄μ μΆκ°ν κΆνμ΄ μλ Discord μλ²
- Discord κ°λ°μ ν¬νΈλ‘ μ΄λ
- "New Application"μ ν΄λ¦νκ³ μ΄λ¦ μ§μ
- "Bot" νμΌλ‘ μ΄λνμ¬ "Add Bot" ν΄λ¦
- "Privileged Gateway Intents" μΉμ
μμ λ€μ νλͺ© νμ±ν:
- Server Members Intent
- Message Content Intent
- λ΄ ν ν° λ³΅μ¬ (λμ€μ νμν¨)
- "OAuth2" > "URL Generator" νμΌλ‘ μ΄λ
- λ€μ μ€μ½ν μ ν:
botapplications.commands
- λ€μ λ΄ κΆν μ ν:
- λ©μμ§ μ½κΈ°/μ±λ 보기
- λ©μμ§ λ³΄λ΄κΈ°
- λ©μμ§ κΈ°λ‘ μ½κΈ°
- μμ± μ°κ²°
- μμ±λ URLμ 볡μ¬νμ¬ λΈλΌμ°μ μμ μ΄μ΄ λ΄μ μλ²μ μ΄λ
- μ΄ μ μ₯μλ₯Ό ν΄λ‘ νκ±°λ λ€μ΄λ‘λ
- μμ‘΄μ± μ€μΉ:
npm install
- νλ‘μ νΈ λ£¨νΈμ λ€μ λ³μκ° ν¬ν¨λ
.envνμΌ μμ±:
# Discord Configuration
DISCORD_TOKEN=λμ€μ½λ_λ΄_ν ν°
DISCORD_USER_ID=λΉμ μ_λμ€μ½λ_μ¬μ©μ_ID
TARGET_VOICE_CHANNEL1_ID=λͺ¨λν°λ§ν _첫λ²μ§Έ_μμ±μ±λ_ID
TARGET_VOICE_CHANNEL2_ID=λͺ¨λν°λ§ν _λλ²μ§Έ_μμ±μ±λ_ID
...
NOTIFICATION_CHANNEL_ID=AFK_μλ¦Όμ©_μ±λ_ID
# NTFY Configuration
NTFY_TOPIC=λΉμ μ_NTFY_ν ν½_μ΄λ¦
νμν IDλ₯Ό μ°Ύλ λ°©λ²:
- Discordμμ κ°λ°μ λͺ¨λ νμ±ν (μ¬μ©μ μ€μ > κ³ κΈ > κ°λ°μ λͺ¨λ)
- μμ± μ±λμ μ°ν΄λ¦νκ³ "ID 볡μ¬"λ₯Ό μ ννμ¬ μμ± μ±λ ID κ°μ Έμ€κΈ°
- μ¬μ©μ μ΄λ¦μ μ°ν΄λ¦νκ³ "ID 볡μ¬"λ₯Ό μ ννμ¬ μ¬μ©μ ID κ°μ Έμ€κΈ°
- ν μ€νΈ μ±λμ μ°ν΄λ¦νκ³ "ID 볡μ¬"λ₯Ό μ ννμ¬ μλ¦Ό μ±λ ID κ°μ Έμ€κΈ°
- μλ¦Όμ μν κ³ μ ν ν ν½ μ΄λ¦ μ ν
- μ΄ ν ν½ μ΄λ¦μ
.envνμΌμNTFY_TOPICμΌλ‘ μΆκ° - λͺ¨λ°μΌ κΈ°κΈ°μ ntfy μ± μ€μΉ
- μ±μμ ν ν½ κ΅¬λ
node index.js/afk λͺ
λ Ήμ΄λ₯Ό μ¬μ©νμ¬ AFK λͺ¨λ κ΄λ¦¬:
/afk action:on- κΈ°λ³Έ λ©μμ§λ‘ AFK λͺ¨λ νμ±ν/afk action:on message:μ¬μ©μ μ μ λ©μμ§- μ¬μ©μ μ μ λ©μμ§λ‘ AFK λͺ¨λ νμ±ν/afk action:on channel:#μ±λ-μ΄λ¦- AFK λͺ¨λ νμ±ν λ° νΉμ μλ¦Ό μ±λ μ€μ /afk action:off- AFK λͺ¨λ λΉνμ±ν
λ΄μ λ€μ μν©μμ μλμΌλ‘ μλ¦Όμ 보λ λλ€:
- μ¬μ©μκ° λͺ¨λν°λ§ μ€μΈ μμ± μ±λμ μ μ₯ν λ
- μ¬μ©μκ° λͺ¨λν°λ§ μ€μΈ μμ± μ±λ κ°μ μ΄λν λ
- μ¬μ©μκ° λͺ¨λν°λ§ μ€μΈ μμ± μ±λμμ ν΄μ₯ν λ
μλ¦Όμ λ€μ κ²½λ‘λ‘ μ μ‘λ©λλ€:
- Discord DM
- ntfy ν ν½ (λͺ¨λ°μΌμμ μμ κ°λ₯)
AFK λͺ¨λκ° νμ±νλλ©΄, λ΄μ μ§μ λ ν μ€νΈ μ±λμ λ©μμ§λ₯Ό λ³΄λ΄ μμ± μ±λμ μ μ₯ν μ¬μ©μμκ² μ리λ₯Ό λΉμ μμ μ립λλ€.
/status λͺ
λ Ήμ΄λ₯Ό μ¬μ©νμ¬ νμ¬ λ΄ μ€μ νμΈ:
- AFK λͺ¨λ νμ±ν μ¬λΆ νμ
- νμ¬ μλ¦Ό μ±λ νμ
- νμ¬ AFK λ©μμ§ νμ
- λͺ¨λ λͺ¨λν°λ§ μ€μΈ μμ± μ±λ λͺ©λ‘ νμΈ
- AFK λͺ¨λκ° νμ±νλ κ²½μ°, λΆμ¬ μ€ μ μ₯ν μ¬μ©μ νμ
λ€μκ³Ό κ°μ λ΄μ μΈ‘λ©΄μ μμ ν μ μμ΅λλ€:
.envνμΌμ μΆκ°νμ¬ λͺ¨λν°λ§ν μμ± μ±λ μΆκ°- μ½λμμ μλ² λ μμ±μ νΈμ§νμ¬ μλ¦Ό νμ λ³κ²½
/afkλͺ λ Ήμ΄λ₯Ό μ¬μ©νμ¬ AFK λ©μμ§ μ¬μ©μ μ μ
- λ΄μ΄ λͺ λ Ήμ μλ΅νμ§ μλ κ²½μ°, Discord κ°λ°μ ν¬νΈμμ μ¬λ°λ₯Έ μΈν νΈλ₯Ό νμ±ννλμ§ νμΈ
- μλ¦Όμ λ°μ§ λͺ»νλ κ²½μ°,
.envνμΌμ μ¬μ©μ IDκ° μ¬λ°λ₯΄κ² μ€μ λμ΄ μλμ§ νμΈ - ntfy λ¬Έμ μ κ²½μ°, ν ν½ μ΄λ¦μ νμΈνκ³ μ±μμ ν΄λΉ ν ν½μ ꡬλ νλμ§ νμΈ
μ΄ νλ‘μ νΈλ μ€ν μμ€μ΄λ©° λꡬλ μ¬μ©νκ³ μμ ν μ μμ΅λλ€.