EvotecIT / PSDiscord

Simple PowerShell module allowing to send messages to Discord Channel over webhooks
47 stars 7 forks source link

Special characters/unicode chars not supported #4

Closed DamianRyse closed 3 years ago

DamianRyse commented 3 years ago

It seems that special characters and unicode chars such as Emotes are not supported. When I send a String to a Discord Webhook URL which contains special characters, they'are being converted to questionmarks.

PrzemyslawKlys commented 3 years ago

I believe you can change this line:

https://github.com/EvotecIT/PSDiscord/blob/807ad63a64bcf5ec01022eb05f715973f75ee4d3/Public/Send-DiscordMessage.ps1#L51

To:

Invoke-RestMethod -Uri $WebHookUrl -Body $Body -Method Post -ContentType 'application/json; charset=UTF-8'  -Verbose:$false

You can edit the PSM1 file in your installed modules - it would be line 508. Remember to Import-Module PSDiscord -Force after change.

image

To fix it. Give it a go and let me know if it works?

DamianRyse commented 3 years ago

It worked like a charm! Thank you!

PrzemyslawKlys commented 3 years ago

I still need to fix this in code here :) Or you can make a PR