Python based Ham Radio Callsign/APRS Discord lookup bot.
This is a Python based, self-hosted, Ham Radio Discord bot that can be added to Ham Radio Discord Servers to add some functionality for various Amatuer Radio Callsign related searches.
Note that this software is intended for use by Amateur Radio Operators only.
This bot pulls data from the following locations:
| Service | Description | Website |
|---|---|---|
| Callook.info | Used for Call Book data lookup | https://callook.info/ |
| HamQTH.com | Used for Call book data lookup for callsigns not found at callook.info | https://www.hamqth.com |
| APRS.FI | Used for APRS Data lookup | https://aprs.fi |
| Radioid.net | Used for DMR/NXDN ID Lookups | https://radioid.net |
Remember that all the commands shared here are for Linux. So if you want you can run this on a Linux Server or even a Raspberry Pi. (Mine is running on a Raspberry Pi 4 2 GB model with many other bots and scripts running with no issues.)
If you want to run this on a Windows or Mac machine, you will need to install Python3 and be familiar installing from a requirements.txt.
The first step in this process will be obtaining the API keys that you need.
New Applicationbot selection under settingsAdd BotPublic BotMessage Intents Setting under Privileged Gateway Intents.OAuth2 and then URL Generatorbot and appplications.commandsUser Settings->Advanced and turn on Developer Mode (if it is not already on.)Copy ID. Then go back into your config.py and paste that ID in the discord_server_id field.Once you have the keys you need and the bot authorized into your server, you will eventually copy them into the appropriate places in the config.py file, but now we need to get the files and get things installed.
The next step is installing the needed packages, cloning the repo to get the script and then installing the needed libraries for the script to work properly.
This is probably the easiest step to accomplish.
Please run the following commands:
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
sudo apt-get install python3 python3-pip git screen
git clone https://github.com/n8acl/hammy-discord-bot.git
cd hammy-discord-bot
pip3 install -r requirements.txt
Now you have everything installed and are ready to configure the script.
Once you have your API Keys, have cloned the repo and installed everything, you can now start configuring the bot. Open the config.py file in your editor of choice and copy in the keys you obtained from APRS.fi and Discord into the appropriate spots.
Once you have the config file edited, start the bot by typing the following:
screen -R hammy-discord-bot
Then in the new window:
cd hammy-discord-bot
python3 hammy_bot.py
Once that is done, hit CTRL-A-D to disconnect from the screen session. If something ever happens, you can reconnect to the session by typing:
screen -R hammy-discord-bot
And see why it errored or quit and restart. This is useful if you need to contact me for support.
All Commands can be issued from any text channel and the message will be returned in a message that only you can see. While callbook data is available online publicly, this helps to keep it at least a little private on the server.
| Command | Description | Example |
|---|---|---|
| /callsign < callsign > | Returns callbook data for the callsign queried, including DMR ID and NXDNID, in a DM. | /callsign W1AW |
| /dmr < dmrid > | Returns callbook data for the DMR ID queried, including DMR ID and NXDNID, in a DM. This is useful to determine who is talking if you see a DMR ID on your Radio that is not loaded into the radio contact list. | /dmr 1234567 |
| /nxdn < nxdnid > | Returns callbook data for the NXDN ID queried, including DMR ID and NXDNID, in a DM. This is useful to determine who is talking if you see a NXDN ID on your Radio that is not loaded into the radio contact list. | /nxdn 1234567 |
| /aprs <callsign+ssid> | Returns last postion beaconed for the station queried. Note that SSID is optional, but it will not do a wildcard or fuzzy search. | /aprs W1AW /aprs W1AW-9 |
| /hammy | Brings up help text with the above command list. | /hammy |
If you have questions, please feel free to reach out to me. You can reach me in one of the following ways:
Or open an issue on Github. I will respond to it, and of course you, when I can. Remember, this is a hobby and there are other daily distractors that come first, like work, school and family.
If you reach out to me and have an error, please include what error you are getting and what you were doing. I may also ask you to send me certain files to look at. Otherwise just reach out to me :).
05/30/2022 - Removed returning data in a DM to returning it as an ephemeral message using slash commands.
05/25/2022 - Version 4.0 Release
pycord discord library for slash command support. This replaces the interactions.py library and the discord.py library.03/14/2022 - Version 3.0 Release
interactions.py for slash command supportinteractions.py does not support file sending at this point and the returns are too large to send via a message.02/19/2022 - Version 2.0 Release
01/18/2022 - Minor Release
01/15/2022 - Initial Release 1.0
Content type
Image
Digest
sha256:e17bf77e9…
Size
350.4 MB
Last updated
over 3 years ago
docker pull n8acl/hammy_bot