From 0a6d397921609df29202052613d961ac76b20885 Mon Sep 17 00:00:00 2001 From: Madpeterz <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 11 Feb 2021 18:44:01 +0000 Subject: [PATCH] adjustments CustomRelay_ caps on C and R Discord relay message uses nickname --- CLI/BetterRelayService/BetterRelay.cs | 4 ++-- CLI/DiscordSupervisor/Inbound.cs | 3 ++- README.md | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CLI/BetterRelayService/BetterRelay.cs b/CLI/BetterRelayService/BetterRelay.cs index b34ba78..65b11a3 100644 --- a/CLI/BetterRelayService/BetterRelay.cs +++ b/CLI/BetterRelayService/BetterRelay.cs @@ -92,9 +92,9 @@ namespace BetterSecondBot.BetterRelayService bool found = true; while (found == true) { - if (helpers.notempty(Environment.GetEnvironmentVariable("customrelay_" + loop.ToString())) == true) + if (helpers.notempty(Environment.GetEnvironmentVariable("CustomRelay_" + loop.ToString())) == true) { - ApplyRelayConfig(Environment.GetEnvironmentVariable("customrelay_" + loop.ToString())); + ApplyRelayConfig(Environment.GetEnvironmentVariable("CustomRelay_" + loop.ToString())); } else { diff --git a/CLI/DiscordSupervisor/Inbound.cs b/CLI/DiscordSupervisor/Inbound.cs index 931a704..0dc2435 100644 --- a/CLI/DiscordSupervisor/Inbound.cs +++ b/CLI/DiscordSupervisor/Inbound.cs @@ -306,7 +306,8 @@ namespace BetterSecondBot.DiscordSupervisor if (message.Author.IsBot == false) { ITextChannel Chan = (ITextChannel)message.Channel; - On_MessageEvent(new DiscordMessageEvent(Chan.GuildId, Chan.Id, message.Author.Username, message.Content)); + IGuildUser user = await Chan.Guild.GetUserAsync(message.Author.Id).ConfigureAwait(true); + On_MessageEvent(new DiscordMessageEvent(Chan.GuildId, Chan.Id, user.Nickname, message.Content)); if (message.Content.StartsWith("!clear") == true) { await CleanDiscordChannel(Chan, 0, true).ConfigureAwait(false); diff --git a/README.md b/README.md index baf6009..6926fc6 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,9 @@ You get set these tokens up by file or Environment Variables. This is to replace the old broken relay thats currently built into the bot -> customrelay_1 = "source-type:discord,source-filter:123451231235@12351312321,target-type:localchat,target-config:4" +> CustomRelay_1 = "source-type:discord,source-filter:123451231235@12351312321,target-type:localchat,target-config:4" -> customrelay_2 = "source-type:discord,source-filter:123451231235@12351312321,target-type:localchat,target-config:4" +> CustomRelay_2 = "source-type:discord,source-filter:123451231235@12351312321,target-type:localchat,target-config:4" or via the config file customrelays