Exemple #1
0
 public static void SendMessage(MessagePayload message)
 {
     if (Properties.Settings.Default.Plugin.ToUpper() == "SLACK")
     {
         Slack.SendToRoom(message, Properties.Settings.Default.RecruitmentRoomName, Properties.Settings.Default.SlackWebhook);
     }
 }
 private static void SendMessage(string message)
 {
     if (Properties.Settings.Default.Plugin.ToUpper() == "HIPCHAT")
     {
         Hipchat.SendToRoom(message, Properties.Settings.Default.RecruitmentRoomName, Properties.Settings.Default.HipchatToken);
     }
     else if (Properties.Settings.Default.Plugin.ToUpper() == "SLACK")
     {
         Slack.SendToRoom(message, Properties.Settings.Default.RecruitmentRoomName, Properties.Settings.Default.SlackWebhook);
     }
 }
 private static void SendMessage(MessagePayload message, string room)
 {
     if (Properties.Settings.Default.Plugin.ToUpper() == "HIPCHAT")
     {
         //Hipchat.SendToRoom(message, Properties.Settings.Default.RoomName, Properties.Settings.Default.HipchatToken);
     }
     else if (Properties.Settings.Default.Plugin.ToUpper() == "SLACK")
     {
         //message = Linkify(message);
         Slack.SendToRoom(message, room, Properties.Settings.Default.SlackWebhook);
     }
 }
Exemple #4
0
        static void Main(string[] args)
        {
            var      messages = GetPings();
            DateTime lastDate;

            if (File.Exists(Path.Combine(Environment.CurrentDirectory, "lastmessage.txt")))
            {
                lastDate = Convert.ToDateTime(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "lastmessage.txt")));
            }
            else
            {
                lastDate = DateTime.Now.AddMinutes(-60);
            }
            foreach (var msg in messages)
            {
                if (msg.Time > lastDate)
                {
                    Slack.SendToRoom(msg.Text, "fleets", "https://hooks.slack.com/services/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", string.Format("{0} via EvePing", msg.Sender));
                }
            }
            File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "lastmessage.txt"), messages[0].Time.ToString("yyyy-MM-ddTHH:mm:ss"));
        }
 private static void SendMessage(string message, string channel = "bottesting")
 {
     Slack.SendToRoom(message, channel, "https://hooks.slack.com/services/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");
 }
Exemple #6
0
 private static void SendMessage(MessagePayload message)
 {
     Slack.SendToRoom(message, Properties.Settings.Default.RoomName, Properties.Settings.Default.SlackWebhook);
 }