EvotecIT / PSDiscord

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

Is Mentioning Roles Possible? Could this Feature be added? #6

Closed Daniel-MFG closed 1 year ago

Daniel-MFG commented 2 years ago

Thanks for this great module! I really enjoy using it and it works really well!

But it (maybe?) misses one thing: You cannot mention users/roles with it... You can only write within the embed and mentions within embeds don't send Notifications... (I am using this for a online checker and i want it to notify a certain role when a service is down)

Is this feature included and just not documented? If it isn't included could you maybe add this functionality? (I am very sorry if i simply missed it...)

PrzemyslawKlys commented 2 years ago

Well, I haven't ever tested it. Normally I would think it's not enabled.

Probably not super complicated. Probably could be added, just I am not super bored to do it right away.

Daniel-MFG commented 2 years ago

I can wait for that of course. But please add this feature as i don't want to switch to some overly complicated language just for this feature. (I don't know of any other PowerShell Discord Module which runs as reliabily as this one)

FurkanVG commented 1 year ago

Hey @Daniel-MFG, i dont know if you still have the issue or if you still need a fix for it. i also ran into your issue to not being able to tag, but then i randomly and accidentally found a "fix":

Just add "@everyone" at the and of the Send-DiscordMessage

Send-DiscordMessage -WebHookUrl $Uri -Sections $Section -AvatarName 'XX' -AvatarUrl "XXX" "@everyone"

This will then just put the message before the Section:

image

Furkan

PrzemyslawKlys commented 1 year ago

Actually like spoke on Discord it's not just "after" the message. It's the Content parameter.

Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'My pester tests - Starting up @everyone' -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png"
Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'My pester tests - Starting up @PrzemyslawKlys' -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png"

It seems to work. I wasn't even aware.