therealguy90 / foundrytodiscord

A FoundryVTT module that sends all FoundryVTT messages to a Discord webhook.
https://ko-fi.com/loki123
MIT License
15 stars 2 forks source link

Feature request: When I use @(player name on discord) in a post on foundry, could it make the ping work on discord? #28

Closed JacobfromAVS closed 8 months ago

JacobfromAVS commented 8 months ago

Is your feature request related to a problem? Please describe. No, This module is life for me!! Great job

Describe the solution you'd like I use this to run a Play By Post in discord and would like to be able to have it so my foundry message when it lands in discord also tags that person if they are mentioned in the foundry post.

Describe alternatives you've considered Right now I go and post in discord and tag those people, but that makes it look unorganized.

therealguy90 commented 8 months ago

That's a little difficult to do, actually. Discord @ tags aren't exactly written in plaintext, so for example, my @ might look like @loki123 on Discord, but in reality, Discord recognizes it as <@468731984034660352>, giving the actual ping. So for the webhook to tag someone, the latter must be used. This will require mapping the @user tag to a <@userid> tag, which is doable. I'm not sure if there's a way to do it automatically, so I'll look into it and see.

JacobfromAVS commented 8 months ago

Ohh thank you! I forgot about the userid, so I will look at using that for now! Thank you. That makes sense why the @here and @everyone tag worked but not @user.

therealguy90 commented 8 months ago

Seems there's no real way to make it automatically grab someone's user id without supplying a personal Discord API token, which could lead to a lot of issues. The best I could do is make a user->userid mapping tool on the module to generate a ping whenever @user is mentioned in a foundry message.

JacobfromAVS commented 8 months ago

Thank you. I will test this once it is implemented. :) Thank you

therealguy90 commented 8 months ago

foundrytodiscord.zip

Here's a test build, feel free to test it out before I commit it. You should see a new "Auto Ping User/Role" setting.

therealguy90 commented 8 months ago

This seems to be working well enough, and I don't see any issues in my testing with it. Including this in next release.

JacobfromAVS commented 8 months ago

This seems to be working well for me. Thank you!