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:
I user this format to send my slack alert, and it worked at first time:
After I change my
slackMessage.Text
to chinese"有使用者登入了"
, it's icon and username is not show like below img:Should I avoid chinese words in message?