A Discord bot for tracking MeshCore repeater public key prefixes across a mesh network. Maintains a 16×16 hex grid showing which 2-character prefixes are in use, who owns each node, and allows easy management via slash commands.
git clone https://github.com/136FA/Mesh-Core-Discord-Prefix-Bot
cd Mesh-Core-Discord-Prefix-Bot
python3 -m venv botenv
source botenv/bin/activate
pip install -r requirements.txt- Go to https://discord.com/developers/applications
- New Application → give it a name
- Bot → Add Bot → copy the token
- Paste your token into
bot.pyreplacingYOUR_BOT_TOKEN_HERE - OAuth2 → URL Generator → check
bot+applications.commands - Bot Permissions: Send Messages + Use Slash Commands
- Open the generated URL to invite the bot to your server
python3 bot.pyOn first run, prefixes.json is created automatically. Use /prefix-add to start adding nodes.
sudo nano /etc/systemd/system/meshbot.service[Unit]
Description=MeshCore Prefix Bot
After=network.target
[Service]
User=YOUR_LINUX_USERNAME
WorkingDirectory=/home/YOUR_LINUX_USERNAME/Mesh-Core-Discord-Prefix-Bot
ExecStart=/home/YOUR_LINUX_USERNAME/Mesh-Core-Discord-Prefix-Bot/botenv/bin/python3 bot.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable meshbot
sudo systemctl start meshbotUseful commands:
sudo systemctl status meshbot # check status
sudo systemctl restart meshbot # restart after updating bot.py
sudo journalctl -u meshbot -f # live logs| Command | Description |
|---|---|
/prefix-show |
Post the ANSI color grid |
/prefix-add C3 My Repeater @jake |
Mark a prefix as used with name and optional owner |
/prefix-remove C3 |
Free a prefix |
/prefix-update C3 name:New Name owner:@jake |
Update name and/or owner |
/prefix-clear-owner C3 |
Remove the owner from a prefix |
/prefix-list |
List all used prefixes, names, and owners |