-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiscordLogger.cs
41 lines (37 loc) · 1.31 KB
/
DiscordLogger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.Entities;
using DSharpPlus.EventArgs;
namespace VoidBot
{
public static class DiscordLogger
{
public static void Init(DiscordClient discord)
{
discord.MessageUpdated += DiscordOnMessageUpdated;
}
private static async Task DiscordOnMessageUpdated(DiscordClient ctx, MessageUpdateEventArgs e)
{
var embed = new DiscordEmbedBuilder
{
Author = new DiscordEmbedBuilder.EmbedAuthor()
{
IconUrl = e.Author.AvatarUrl,
Url = e.Message.JumpLink.ToString(),
Name = "Message Edited"
},
Color = default,
Description = $"in {Formatter.Mention(e.Channel)}",
Footer = null,
ImageUrl = null,
Thumbnail = null,
Timestamp = e.Message.EditedTimestamp,
Url = e.Message.JumpLink.ToString()
};
embed.AddField("User", e.Author.Mention, true);
embed.AddField("Before", e.MessageBefore.Content);
embed.AddField("After", e.Message.Content);
await ctx.SendMessageAsync(e.Guild.GetChannel(607392574235344928), embed);
}
}
}