Closed ericbrunner closed 4 years ago
Hi Eric Have you got these usings at the top of your file:
using SlackBotMessages;
using SlackBotMessages.Enums;
using SlackBotMessages.Models;
Hi Paul Thanks for your effort. Yes I added it. Still same result.
Here the full sample code:
using System;
using System.Threading.Tasks;
using SlackBotMessages;
using SlackBotMessages.Enums;
using SlackBotMessages.Models;
namespace CodemeterWatchdog
{
class Program
{
static string webHookUrl = "my-url";
static async Task Main(string[] args)
{
#region Post a Slack Bot Message
try
{
var client = new SbmClient(webHookUrl);
var message = new Message
{
Username = "CodemeterWatchDog",
Text = "Codemeter LicenseServer has 0 licenses left",
IconEmoji = Emoji.ArrowRight
};
await client.SendAsync(message);
Console.WriteLine($"message sent: {message.Username}:{message.Text}");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
#endregion
Console.ReadKey();
}
}
}
Best, Eric
I can get it working here https://dotnetfiddle.net/gLQVC4#
You posted mycode to public domain. Please delete that dotnetfiddle. Further it doesn't work
You posted your code here first which is public. I just put it in a private dotnetfiddle and shared the link here where you’d already shared the code. I’m sorry, I was just trying to help you.
Hi Paul,
I use your sample and it works , dispite the IconEmoji. Am I doing something wrong? Here my code:
I get that: