-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support mattermost notifier #31
Conversation
search.go
Outdated
apiToken := os.Getenv("MATTERMOST_API_TOKEN") | ||
client := mattermost.NewAPIv4Client(os.Getenv("MATTERMOST_URL")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frezbo it should also work if someone passes the creds with CLI flags
search.go
Outdated
if res.StatusCode != 200 { | ||
return errors.New("Auth failure") | ||
} | ||
direct, res := client.CreateDirectChannel(user.Id, os.Getenv("MATTERMOST_USER_ID")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, it should be possible to provide userID as a CLI flag
README.md
Outdated
#### Notifications to mattermost | ||
|
||
``` | ||
ATTERMOST_URL="<mattermost url>" MATTERMOST_API_TOKEN="<mattermost bot api token>" MATTERMOST_USER_ID="<mattermost user id>" ./covaccine-notifier --state Maharashtra --district Akola --age 27 -n mattermost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an example with CLI flags. It should be possible to provide Mattermost creds with CLI args
@frezbo Please run |
FYI, I am working on refactoring notifier interface. We might need to do some changes accordingly |
I'll create a new PR once #33 is merged. So that I can rebase based on the new notifier interface. Thanks 👍 |
Signed-off-by: Noel Georgi git@frezbo.dev