mirror of
https://github.com/idanoo/NZCovidBot
synced 2025-07-01 03:02:15 +00:00
Add example images
This commit is contained in:
parent
aeae0ef8ee
commit
e1bb1a1ebe
5 changed files with 14 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
## 1.1
|
||||
- Split messages based on location
|
||||
- Added systemd service
|
||||
- Default to current time instead of 1970 (Unix timestamp 0)
|
||||
|
||||
## 1.0
|
||||
- Reworked to use API
|
||||
|
|
|
@ -16,8 +16,15 @@ Copy .env.example to .env and fill in the webhook URLs
|
|||
### Build
|
||||
```
|
||||
go build -o nzcovidbot cmd/nzcovidbot/*.go
|
||||
./nzcovidbot
|
||||
sudo cp nzcovidbot.service /etc/systemd/system/nzcovidbot.service
|
||||
# Update user + location of repo in systemd file
|
||||
sudo systemctl daemon-reload && systemctl enable --now nzcovidbot.service
|
||||
```
|
||||
|
||||
### Screenshots
|
||||
|
||||
#### Discord
|
||||

|
||||
|
||||
#### Slack
|
||||

|
BIN
discordexample.png
Normal file
BIN
discordexample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 141 KiB |
|
@ -42,7 +42,7 @@ func Lesgoooo() {
|
|||
// getLastPollTime - If run previously, get last TS, otherwise Now()
|
||||
func getLastPollTime() time.Time {
|
||||
// Set default of *now* if never run so we don't spam everything
|
||||
lastUpdated = time.Now()
|
||||
lastPoll := time.Now()
|
||||
|
||||
// Load up last-polled date if set
|
||||
file, err := os.Open("lastUpdated.txt")
|
||||
|
@ -50,17 +50,19 @@ func getLastPollTime() time.Time {
|
|||
b, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
log.Printf("Unable to read lastUpdated.txt: %s", err)
|
||||
return lastPoll
|
||||
}
|
||||
|
||||
i, err := strconv.ParseInt(string(b), 10, 64)
|
||||
if err != nil {
|
||||
log.Printf("Unable to read lastUpdated.txt: %s", err)
|
||||
return lastPoll
|
||||
}
|
||||
|
||||
lastUpdated = time.Unix(i, 0)
|
||||
lastPoll = time.Unix(i, 0)
|
||||
}
|
||||
|
||||
return lastUpdated
|
||||
return lastPoll
|
||||
}
|
||||
|
||||
func postTheUpdates() {
|
||||
|
|
BIN
slackexample.png
Normal file
BIN
slackexample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
Loading…
Add table
Add a link
Reference in a new issue