Slacker.jl

A Julia Package that allows sending message to slack (e.g. to let you know a simulation has completed).
Author Sumidu
Popularity
2 Stars
Updated Last
4 Years Ago
Started In
October 2019

Slacker

Stable Dev Mac/Linux Windows Codecov Coveralls

A package that allows sending to slack. It uses a configuration file stored in the home directory of the user. It allows for multiple named configurations, if several slack servers are used.

NOTE Version 1.0 breaks compatibility with earlier versions.

Installation

using Pkg
Pkg.add("Slacker")

Usage

  using Slacker

  # replace the url with your incoming Webhook URL
  cfg = SlackConfig("https://hooks.slack.com/services/....", "JuliaBot", "#general", ":ghost:")

  addConfig(cfg)

  sendMessage("Hi this is a Test from Slacker.")

Using Multiple Servers

  using Slacker

  cfg1 = SlackConfig("url1", "JuliaBot", "#general", ":ghost:")
  cfg2 = SlackConfig("url2", "JuliaBot2", "@sumidu", ":smile:")

  addConfig(cfg, "server1")
  addConfig(cfg, "server2")

  sendMessage("Hi this is a Test from Slacker to server1.", "server1")
  sendMessage("Hi this is a Test from Slacker to server1.", "server2")

Changing the channel or username of a configuration temporarily

  using Slacker

  cfg = loadConfig("server1")
  cfg.channel = "#random"
  cfg.user = "Julia Random Bot"
  cfg.icon_emoji = ":grinning:"

  sendMessage("Hi this is a Test from Slacker to server1.", cfg)

Used By Packages

No packages found.