Skip to content

jondpugh/Discord-ACARS-HoppieBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HoppieBot

A Discord bot that integrates with the Hoppie ACARS system for flight simulation. This bot monitors incoming ACARS messages and allows sending messages via Discord.

Features

  • 🔄 Real-time Message Polling - Automatically checks for new messages from Hoppie ACARS
  • 💬 Discord Integration - Sends received messages to a dedicated Discord channel
  • 📤 Send Messages - Send ACARS messages directly from Discord using commands
  • ✈️ CPDLC Support - Send Controller-Pilot Data Link Communications messages
  • 🔌 Status Monitoring - Check bot and Hoppie connection status
  • 📝 Rich Embeds - Messages are formatted as Discord embeds for clarity

Requirements

Installation

  1. Clone or extract the project to your desired location

  2. Install dependencies:

npm install
  1. Create a .env file based on .env.example:
cp .env.example .env
  1. Edit .env and add your configuration:
DISCORD_TOKEN=your_discord_bot_token_here
CHANNEL_ID=your_discord_channel_id_here
HOPPIE_LOGON_CODE=your_hoppie_logon_code_here
HOPPIE_CALLSIGN=your_aircraft_callsign_here
POLL_INTERVAL=60000

Getting Your Discord Token and Channel ID

  1. Go to Discord Developer Portal
  2. Create a new application
  3. Go to "Bot" section and create a bot
  4. Copy the bot token and paste it in .env
  5. Go to "OAuth2" → "URL Generator" and select:
    • Scopes: bot
    • Permissions: Send Messages, Read Messages/View Channels, Embed Links
  6. Use the generated URL to invite the bot to your server
  7. In Discord, enable Developer Mode (User Settings → Advanced → Developer Mode)
  8. Right-click on the desired channel and select "Copy Channel ID"
  9. Paste this in .env

Getting Your Hoppie Logon Code

  1. Visit Hoppie ACARS
  2. Register or log in to your account
  3. Your logon code will be displayed in your account settings

Usage

Starting the Bot

npm start

Or for development with auto-reload:

npm run dev

Discord Commands

Command Usage Description
!send !send <CALLSIGN> <message> Send an ACARS telex message to another aircraft
!cpdlc !cpdlc <CALLSIGN> <message> Send a CPDLC (Controller-Pilot Data Link) message
!status !status Check bot and Hoppie connection status
!hoppiehelp !hoppiehelp Display available commands and CPDLC reference

Examples

Send a telex message to another aircraft:

!send N1234 Hello, how is your flight?

Send a CPDLC message with proper format:

!cpdlc STATION /data2/8030//R/PDC. Cleared to YSSY via KEPPA

CPDLC Header Format Reference

Standard CPDLC header structure:

/data2/<msgid>//<direction>/<type>

Components:

  • /data2/ - Data block identifier v2
  • 8030 - Message reference/transaction ID
  • // - Separator
  • R/U/D - Direction (Response/Unsolicited/Downlink)

Message Types:

  • PDC - Pre-Departure Clearance
  • ATC - Air Traffic Control
  • REQ - Request
  • INFO - Informational

Example:

/data2/8030//R/PDC. QFA1200 B738 YPPH 0154. CLEARED TO...

Check if bot is working:

!status

How It Works

  1. Polling: The bot continuously polls the Hoppie ACARS server at regular intervals (default: 60 seconds)
  2. Message Reception: When new messages arrive for your callsign, they are automatically posted to the Discord channel
  3. Message Sending: Discord messages with the !send command are sent via the Hoppie API
  4. Duplicate Prevention: The bot tracks message IDs to prevent duplicate postings

Configuration

Poll Interval

Adjust POLL_INTERVAL in your .env file to control how often the bot checks for messages:

POLL_INTERVAL=60000  # Check every 60 seconds (in milliseconds)

Note: Be respectful to the Hoppie servers. Hoppie API recommends 45-75 seconds, but avoid excessive polling.

Troubleshooting

API Connection Issues

Error: Failed to connect to Hoppie ACARS or 404 Not Found

The Hoppie ACARS API endpoints appear to be temporarily unavailable. The Hoppie website indicates they've been restructured and not all content has been restored.

Solutions: Adjust POLL_INTERVAL in your .env file to control how often the bot checks for messages (default: 60 seconds):

POLL_INTERVAL=60000

Note: Be respectful to the Hoppie servers.

Discord Bot Requirements

  • ✅ MESSAGE CONTENT INTENT
  • ✅ SERVER MEMBERS INTENT (optional but recommended)
  • ✅ DIRECT MESSAGE INTENT (optional)

"Cannot fetch channel" error

Bot doesn't connect to Discord

  • Verify your DISCORD_TOKEN is correct
  • Ensure the bot has permissions in the channel
  • Enable required intents in Discord Developer Portal:
    • ✅ MESSAGE CONTENT INTENT

Cannot fetch channel error

  • Ensure the CHANNEL_ID is correct
  • Verify the bot has permissions to read and send messages in that channel
  • Enable Developer Mode in Discord to copy channel IDs (User Settings → Advanced → Developer Mode)

License

MIT License

Copyright (c) 2025 Jon Pugh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Support

For Hoppie-related questions, visit Hoppie's website or contact hoppie@hoppie.nl

About

Setup a discord bot to send and receive messages via the Hoppie ACARS system to your VA aircraft

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors