From 1905fdec04152e1fd63e26ebf7707a1d11a4d0f3 Mon Sep 17 00:00:00 2001 From: Christopher F Date: Tue, 20 Mar 2018 16:44:30 -0400 Subject: [PATCH] Add BanAsync extension to IGuildUser --- src/Discord.Net.Core/Extensions/UserExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Discord.Net.Core/Extensions/UserExtensions.cs b/src/Discord.Net.Core/Extensions/UserExtensions.cs index 863201cfe..d3e968e39 100644 --- a/src/Discord.Net.Core/Extensions/UserExtensions.cs +++ b/src/Discord.Net.Core/Extensions/UserExtensions.cs @@ -46,5 +46,8 @@ namespace Discord return await (await user.GetOrCreateDMChannelAsync().ConfigureAwait(false)).SendFileAsync(filePath, text, isTTS, embed, options).ConfigureAwait(false); } #endif + + public static Task BanAsync(this IGuildUser user, int pruneDays = 0, string reason = null, RequestOptions options = null) + => user.Guild.AddBanAsync(user, pruneDays, reason, options); } }