Skip to content

Commit

Permalink
Re-fetch message when deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Aug 3, 2022
1 parent 01b6703 commit 32e44ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Hammer/Services/MessageDeletionService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DSharpPlus;
using DSharpPlus;
using DSharpPlus.Entities;
using Hammer.Configuration;
using Hammer.Data;
Expand Down Expand Up @@ -63,6 +63,7 @@ public async Task DeleteMessageAsync(DiscordMessage message, DiscordMember staff
if (message is null) throw new ArgumentNullException(nameof(message));
if (staffMember is null) throw new ArgumentNullException(nameof(staffMember));

message = await message.Channel.GetMessageAsync(message.Id).ConfigureAwait(false);
DiscordGuild guild = message.Channel.Guild;

if (guild != staffMember.Guild)
Expand Down

0 comments on commit 32e44ca

Please sign in to comment.