Object to send messages to Slack using curl. More...
#include <slack_messenger.h>
Definition at line 37 of file slack_messenger.h.
Public Member Functions | |
| slack_messenger (std::string p_channel="", std::string p_username="", std::string p_url="", bool p_mpi_time=false) | |
| Create a messenger object with specified channel, username, URL and time method. More... | |
| void | set_time_mode (bool loc_mpi_time) |
| Set the time mode (normal or MPI) | |
| bool | set_url_from_env (std::string env_var) |
| Set the Slack webhook URL from an environment variable. | |
| bool | set_channel_from_env (std::string env_var) |
| bool | set_username_from_env (std::string env_var) |
| Desc. | |
| int | send (std::string message, bool err_on_fail=true) |
| Send a message. | |
Public Attributes | |
| std::string | url |
| The URL for the Slack webhook. | |
| std::string | channel |
| The destination channel. | |
| double | min_time_between |
| Minimum time between messages in seconds (default 300) | |
| std::string | icon |
| Icon to use (without colons; default "computer") | |
| std::string | username |
| Slack username. | |
| int | verbose |
| Verbosity parameter (default 1) | |
Protected Attributes | |
| double | time_last_message |
| Time (in seconds) the last message was sent. | |
| bool | mpi_time |
| If true, use MPI to determine time. | |
|
inline |
If the URL is not specified, this constructor tries to determine it from the environment variable O2SCL_SLACK_URL .
Definition at line 81 of file slack_messenger.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).