diff --git a/PokemonGoRaidBot/CommandHandler.cs b/PokemonGoRaidBot/CommandHandler.cs
index b124ec4..647a0f8 100644
--- a/PokemonGoRaidBot/CommandHandler.cs
+++ b/PokemonGoRaidBot/CommandHandler.cs
@@ -258,36 +258,29 @@ public async Task MakePost(PokemonRaidPost post, MessageParser parser)
var fromChannel = GetChannel(post.FromChannelId);
var outputChannel = GetChannel(post.OutputChannelId);
- if (post.Pin && post.MessageId != default(ulong))
+ var messages = parser.MakePostStrings(post);
+ RestUserMessage messageResult;
+ if (post.Pin && fromChannel != null)
{
- if(fromChannel != null)
- {
+ var changed = true;
+ var fromChannelMessage = Regex.Replace(messages[0], @" in \<\#[0-9]*\>", "");
+ if (post.MessageId != default(ulong))
+ {
deleteMessage = await fromChannel.GetMessageAsync(post.MessageId);
- if (deleteMessage.IsPinned)
- {
- await ((RestUserMessage)deleteMessage).UnpinAsync();
- }
- await deleteMessage.DeleteAsync();
- }
- }
- if(outputChannel != null)
- {
- foreach (var messageId in post.OutputMessageIds)
- {
- deleteMessage = await outputChannel.GetMessageAsync(messageId);
- await deleteMessage.DeleteAsync();
- }
- }
- RestUserMessage messageResult;
-
- var messages = parser.MakePostStrings(post);
+ changed = !deleteMessage?.Content.Equals(fromChannelMessage, StringComparison.OrdinalIgnoreCase) ?? true;
- if (post.Pin)
- {
- if(fromChannel != null)
+ if (changed)
+ {
+ if (deleteMessage.IsPinned)
+ {
+ await ((RestUserMessage)deleteMessage).UnpinAsync();
+ }
+ await deleteMessage.DeleteAsync();
+ }
+ }
+ if (changed)
{
- var fromChannelMessage = Regex.Replace(messages[0], @" in \<\#[0-9]*\>", "");
messageResult = await fromChannel.SendMessageAsync(fromChannelMessage);
try
{
@@ -298,12 +291,19 @@ public async Task MakePost(PokemonRaidPost post, MessageParser parser)
DoError(e);
}
post.MessageId = messageResult.Id;
+
}
- }
- post.OutputMessageIds.Clear();
- if (outputChannel != null)
+ }
+ if(outputChannel != null)
{
+ foreach (var messageId in post.OutputMessageIds)
+ {
+ deleteMessage = await outputChannel.GetMessageAsync(messageId);
+ await deleteMessage.DeleteAsync();
+ }
+ post.OutputMessageIds.Clear();
+
foreach (var message in messages)
{
messageResult = await outputChannel.SendMessageAsync(message);
diff --git a/PokemonGoRaidBot/PokemonGoRaidBot.csproj b/PokemonGoRaidBot/PokemonGoRaidBot.csproj
index 983e32b..86649fe 100644
--- a/PokemonGoRaidBot/PokemonGoRaidBot.csproj
+++ b/PokemonGoRaidBot/PokemonGoRaidBot.csproj
@@ -35,5 +35,21 @@
Always
-
+
+
+ 1.0.0
+ beta
+
+
+
+ wpatter6
+ wpatter6
+ en-US
+ PokemonGoRaidBot
+
+ Discord bot for pokemon go raids.
+
+ PokemonGoRaidBot
+ aaabbbcccddd_eeefffggghhh
+
\ No newline at end of file