Class slack_messenger (o2scl)¶
-
class
o2scl
::
slack_messenger
¶ Object to send messages to Slack using curl.
- Note
Experimental
Public 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.
If the URL is not specified, this constructor tries to determine it from the environment variable
O2SCL_SLACK_URL
.
-
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 Members
-
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)