<commit_before>﻿using System;
using System.Threading.Tasks;
using Discord;

namespace DiscordBot.Extensions
{
    public static class TaskExtensions
    {
        public static Task DeleteAfterTime(this IDeletable message, int seconds = 0, int minutes = 0, int hours = 0, int days = 0) => message.DeleteAfterSeconds(new TimeSpan(seconds, minutes, hours, days));
        public static Task DeleteAfterSeconds(this IDeletable message, double seconds) => message.DeleteAfterSeconds(TimeSpan.FromSeconds(seconds));
        public static Task DeleteAfterSeconds(this IDeletable message, TimeSpan timeSpan)
        {
            return Task.Delay(timeSpan).ContinueWith(async _ => await message.DeleteAsync());
        }

        public static Task DeleteAfterTime<T>(this Task<T> task, int seconds = 0, int minutes = 0, int hours = 0, int days = 0, bool awaitDeletion = false) where T : IDeletable => task.DeleteAfterTimeSpan(new TimeSpan(seconds, minutes, hours, days), awaitDeletion);
        public static Task DeleteAfterSeconds<T>(this Task<T> task, double seconds, bool awaitDeletion = false) where T : IDeletable => task.DeleteAfterTimeSpan(TimeSpan.FromSeconds(seconds), awaitDeletion);
        public static Task DeleteAfterTimeSpan<T>(this Task<T> task, TimeSpan timeSpan, bool awaitDeletion = false) where T : IDeletable
        {
            var deletion = Task.Run(async () => await (await task).DeleteAfterSeconds(timeSpan));
            return awaitDeletion ? deletion : task;
        }
    }<commit_msg>Minor naming fix in TaskExtension<commit_after>﻿using System;
using System.Threading.Tasks;
using Discord;

namespace DiscordBot.Extensions
{
    public static class TaskExtensions
    {
        public static Task DeleteAfterTime(this IDeletable message, int seconds = 0, int minutes = 0, int hours = 0, int days = 0) => message.DeleteAfterTimeSpan(new TimeSpan(seconds, minutes, hours, days));
        public static Task DeleteAfterSeconds(this IDeletable message, double seconds) => message.DeleteAfterTimeSpan(TimeSpan.FromSeconds(seconds));
        public static Task DeleteAfterTimeSpan(this IDeletable message, TimeSpan timeSpan)
        {
            return Task.Delay(timeSpan).ContinueWith(async _ => await message.DeleteAsync());
        }

        public static Task DeleteAfterTime<T>(this Task<T> task, int seconds = 0, int minutes = 0, int hours = 0, int days = 0, bool awaitDeletion = false) where T : IDeletable => task.DeleteAfterTimeSpan(new TimeSpan(seconds, minutes, hours, days), awaitDeletion);
        public static Task DeleteAfterSeconds<T>(this Task<T> task, double seconds, bool awaitDeletion = false) where T : IDeletable => task.DeleteAfterTimeSpan(TimeSpan.FromSeconds(seconds), awaitDeletion);
        public static Task DeleteAfterTimeSpan<T>(this Task<T> task, TimeSpan timeSpan, bool awaitDeletion = false) where T : IDeletable
        {
            var deletion = Task.Run(async () => await (await task).DeleteAfterTimeSpan(timeSpan));
            return awaitDeletion ? deletion : task;
        }
    }
{'fraction_non_alphanumeric': 0.09239842726081259, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 4.029654036243822, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7560631', 'n_tokens_mistral': 840, 'n_tokens_neox': 805, 'n_words': 256}