GeorgH93 / MarriageMaster

Marriage Plugin for Bukkit/Spigot
https://www.spigotmc.org/resources/marriage-master.19273/
GNU General Public License v3.0
115 stars 88 forks source link

Marriage Master Bukit Event - Discord SRV #256

Open XxPoNaGeXx opened 2 years ago

XxPoNaGeXx commented 2 years ago

Hi, there I'm using discordsrv alerts to announce marriages and divorces.

 # Send a divorce message
  - Trigger: DivorcedEvent
    Channel: global
    Embed:
      Color: "#bc1e1b"
      ImageUrl: ""
      Author:
        Name: "${#event.getPlayer1()} and ${#event.getPlayer2()} just got divorced"
        ImageUrl: "{embedavatarurl}"
        Url: ""

Is what I have so far but this returns image

Any idea on how to get this to return actual usernames/displaynames?

XxPoNaGeXx commented 2 years ago

DiscordSRV] Plugin DiscordSRV v1.25.0 generated an exception while executing task 906556 18.03 21:38:07 [Server] INFO org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method getPlayer1() cannot be found on type at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarriedEvent

GeorgH93 commented 2 years ago

Never used the that plugin, but if I understand there documentation correctly, this should work:

MarriedEvent: #event.getMarriageData().getPartner1().getName() and #event.getMarriageData().getPartner2().getName()

DivorcedEvent: #event.getPlayer1().getName() and #event.getPlayer2().getName()

Replace getName() with getDisplayName() for the display name.