diff --git a/.github/workflows/github-releases-to-discord.yml b/.github/workflows/github-releases-to-discord.yml new file mode 100644 index 0000000..9deb1ad --- /dev/null +++ b/.github/workflows/github-releases-to-discord.yml @@ -0,0 +1,21 @@ +on: + release: + types: [published] + +jobs: + github-releases-to-discord: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Github Releases To Discord + uses: SethCohen/github-releases-to-discord@v1.13.1 + with: + webhook_url: ${{ secrets.WEBHOOK_URL }} + color: "2105893" + username: "New Release" + avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png" + content: "<@&1263501199156445265> - There's a new Release for Echosync!" + footer_title: "New release" + footer_icon_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png" + footer_timestamp: true diff --git a/Echosync/Helper/AddonTalkHelper.cs b/Echosync/Helper/AddonTalkHelper.cs index 1f7f2e9..765b7b5 100644 --- a/Echosync/Helper/AddonTalkHelper.cs +++ b/Echosync/Helper/AddonTalkHelper.cs @@ -66,7 +66,7 @@ private unsafe void OnPostDraw(AddonEvent type, AddonArgs args) { activeDialogue = dialogue; SyncClientHelper.CurrentEvent = LogHelper.EventId(MethodBase.GetCurrentMethod().Name, Enums.TextSource.Sync); - SyncClientHelper.CreateMessage(SyncMessages.JoinDialogue, clientState.LocalPlayer?.Name.TextValue ?? "TEST", activeDialogue); + SyncClientHelper.CreateMessage(SyncMessages.JoinDialogue, activeDialogue); } @@ -81,7 +81,7 @@ private unsafe void OnPostDraw(AddonEvent type, AddonArgs args) if (!visible && !string.IsNullOrWhiteSpace(activeDialogue) && SyncClientHelper.Connected) { LogHelper.Info(MethodBase.GetCurrentMethod().Name, $"Addon closed", SyncClientHelper.CurrentEvent); - SyncClientHelper.CreateMessage(SyncMessages.LeaveDialogue, clientState.LocalPlayer?.Name.TextValue ?? "TEST", activeDialogue); + SyncClientHelper.CreateMessage(SyncMessages.LeaveDialogue, activeDialogue); LogHelper.End(MethodBase.GetCurrentMethod().Name, SyncClientHelper.CurrentEvent); readySend = false; SyncClientHelper.AllReady = false; @@ -110,7 +110,7 @@ private unsafe void OnPreReceiveEvent(AddonEvent type, AddonArgs args) if (!readySend) { - SyncClientHelper.CreateMessage(SyncMessages.Click, clientState.LocalPlayer?.Name.TextValue ?? "TEST", activeDialogue); + SyncClientHelper.CreateMessage(SyncMessages.Click, activeDialogue); readySend = true; } } diff --git a/Echosync/Helper/SyncClientHelper.cs b/Echosync/Helper/SyncClientHelper.cs index 0a3618f..788a626 100644 --- a/Echosync/Helper/SyncClientHelper.cs +++ b/Echosync/Helper/SyncClientHelper.cs @@ -138,7 +138,7 @@ public static void RequestChannel(SyncMessages message, string channel) } } - public static void CreateMessage(SyncMessages message, string extra = "", string extra2 = "") + public static void CreateMessage(SyncMessages message, string extra = "") { try { @@ -149,10 +149,10 @@ public static void CreateMessage(SyncMessages message, string extra = "", string return; } + var characterName = "|" + ClientState.LocalPlayer?.Name.TextValue + "@" + ClientState.LocalPlayer?.HomeWorld.Id ?? "TEST"; extra = !string.IsNullOrWhiteSpace(extra) ? "|" + extra : ""; - extra2 = !string.IsNullOrWhiteSpace(extra2) ? "|" + extra2 : ""; - var bodyString = $"{((int)message)}{extra}{extra2}"; + var bodyString = $"{((int)message)}{characterName}{extra}"; WebSocket.Send(bodyString); LogHelper.Info(MethodBase.GetCurrentMethod().Name, $"Sent '{message.ToString()}' to channel: {ActiveChannel}", CurrentEvent); }