mrb0nj / Slack.Webhooks

Even simpler integration with Slack's Incoming and Outgoing webhooks
MIT License
173 stars 53 forks source link

Username and IconUrl sometimes disappear but I can't get the reason #98

Closed anthea-wu closed 3 years ago

anthea-wu commented 3 years ago

I user this format to send my slack alert, and it worked at first time:

var slackMessage = new SlackMessage
{
    Channel = "#植物病蟲害測試alert",
    Text = "Your message",
    IconUrl= new Uri("https://ruralgis.tari.gov.tw/PpsSurvey/images/logo.png"),
    Username = "植物病蟲害系統"
};

slackMessage.Blocks = new List<Block>
{
    new Header
    {
        Text = new TextObject("有使用者登入了")
    },
    new Section
    {
        Text = new TextObject(
            $"*登入時間:* {time:yyyy-MM-dd hh:mm:ss}\n*使用者名稱:* {user.name}\n*使用者帳號:* {user.account}")
        {
            Type = TextObject.TextType.Markdown
        },
    }
};
slackClient.Post(slackMessage);

After I change my slackMessage.Text to chinese "有使用者登入了", it's icon and username is not show like below img:

image

Should I avoid chinese words in message?