Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
tblanarik committed Sep 23, 2024
1 parent ea3681e commit c189a53
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Description

Spotbot is a simple Azure Function App to convert [HamAlert](https://hamalert.org/) alerts from [POTA](https://pota.app) or [SOTA](https://www.sota.org.uk/) in to a message format that can be forwarded on to a Discord channel webhook.
Spotbot is an Azure Function App to convert [HamAlert](https://hamalert.org/) alerts from [POTA](https://pota.app) or [SOTA](https://www.sota.org.uk/) in to a message format that can be forwarded on to a Discord channel webhook.

| HamAlert Configuration |
| -- |
Expand All @@ -13,12 +13,21 @@ Spotbot is a simple Azure Function App to convert [HamAlert](https://hamalert.or
| ![image](https://github.com/user-attachments/assets/f664d60f-2042-4b2d-9c88-4ce4051f17c7) |


## Requirements
The function uses a Table in an Azure Storage Account to store the `messageId` of the last message posted for each callsign. If that message was posted recently (as defined by `LOOKBACK_SECONDS`), it will _update_ the message instead of posting a new one to reduce the chatter of the bot.

- Python 3.x
- Azure Functions
- requests
You can find a live, working version of this bot in the [Cascadia Radio](https://www.cascadiaradio.org/) Discord server, in the `#spots` channel. Join us!

## Config

The Azure Function App expects one environment variable: `TARGET_URL`, which should be the webhook URL from the target Discord channel.
The Azure Function App expects three environment variables:
- `TARGET_URL` - the webhook URL from the target Discord channel.
- `LOOKBACK_SECONDS` - the number of seconds to look backwards for previous messages to update instead of posting a new one
- `TABLE_NAME` - the name of the table in the Azure Storage Account where the last messageIds will be stored for each callsign

## Deploy Notes

- Some basic tests run in `tests.py` on the creation of a new PR
- To deploy, manually run `main_hamalertspotbot.yml`
- This will deploy to the staging slot for testing.
- The staging `TARGET_URL` points to my private Discord server
- `LOOKBACK_SECONDS` is set to only 300 (instead of 7200) for easier testing.

0 comments on commit c189a53

Please sign in to comment.