chore: src/ structure
This commit is contained in:
@@ -4,7 +4,8 @@ CLI Whatsapp Messages (and Polls) using go:
|
|||||||
- [urfave/cli](https://github.com/urfave/cli) for the command line
|
- [urfave/cli](https://github.com/urfave/cli) for the command line
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
Can be easily scheduled using `crontab` because of its non-interactive operation
|
Can be easily scheduled using `crontab` because of its non-interactive operation.
|
||||||
|
Avoid quick consecutive logins by using the stdin option to send multiple messages in one session.
|
||||||
```
|
```
|
||||||
NAME:
|
NAME:
|
||||||
schneller-whatsapp - Run WhatsApp actions from your CLI. User JID has to end with '@s.whatsapp.net', Group ID with '@g.us'. Defaults to listening on stdin for batch processing.
|
schneller-whatsapp - Run WhatsApp actions from your CLI. User JID has to end with '@s.whatsapp.net', Group ID with '@g.us'. Defaults to listening on stdin for batch processing.
|
||||||
|
|||||||
2
src/log.go
Normal file
2
src/log.go
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// https://github.com/tulir/whatsmeow/blob/071293c6b9f03f66d2e50bdd659536611d2e10f3/util/log/log.go
|
||||||
|
package main
|
||||||
@@ -80,10 +80,10 @@ func sendMessage(message *waE2E.Message, jidStr string, client *whatsmeow.Client
|
|||||||
}
|
}
|
||||||
_, err = client.SendMessage(context.Background(), JID, message)
|
_, err = client.SendMessage(context.Background(), JID, message)
|
||||||
// FIXME showing error even when successful
|
// FIXME showing error even when successful
|
||||||
if err == nil {
|
if err != nil {
|
||||||
slog.Info("Sent Message successfully")
|
|
||||||
} else {
|
|
||||||
slog.Error("Failed to send message", "error", err)
|
slog.Error("Failed to send message", "error", err)
|
||||||
|
} else {
|
||||||
|
slog.Info("Sent Message successfully")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user