コード例 #1
0
ファイル: WarnModule.cs プロジェクト: WaifuShork/NamorokaV2
        public async Task Warn(SocketGuildUser user, [Remainder] string reason)
        {
            await DatabaseService.AddInfractionAsync(user, reason);

            var builder = new EmbedBuilder();

            builder.WithAuthor($"[Warned User] {user}", user.GetAvatarUrl());
            builder.WithColor(Color.Red);
            builder.AddField("Reason", reason);
            builder.AddField("User Responsible", Context.Message.Author);
            builder.WithCurrentTimestamp();

            var embed = builder.Build();

            await Extensions.Extensions.SendLogMessageAsync(embed);

            await Context.Channel.SendMessageAsync(embed : embed);

            var message = Context.Message;
            await Context.Channel.DeleteMessageAsync(message);
        }