<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.CommandsNext.Converters;
using DSharpPlus.Entities;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Enums;
using DSharpPlus.Interactivity.EventHandling;
using Humanizer;
using Humanizer.Localisation;
using ModCore.Database;
using ModCore.Entities;
using ModCore.Listeners;
using ModCore.Logic;
using ModCore.Logic.Extensions;
using ModCore.Logic.Utils;

namespace ModCore.Commands
{
	public class Main : BaseCommandModule
	{
		private static readonly Regex SpaceReplacer = new Regex(" {2,}", RegexOptions.Compiled);

		public SharedData Shared { get; }
		public DatabaseContextBuilder Database { get; }
		public InteractivityExtension Interactivity { get; }
		public StartTimes StartTimes { get; }

		public Main(SharedData shared, DatabaseContextBuilder db, InteractivityExtension interactive,
			StartTimes starttimes)
		{
			this.Database = db;
			this.Shared = shared;
			this.Interactivity = interactive;
			this.StartTimes = starttimes;
		}

		[Command("about"), Description("About this bot.")]
		public async Task AboutAsync(CommandContext ctx)
		{
			var eb = new DiscordEmbedBuilder()
				.WithColor(new DiscordColor("#C1272D"))
				.WithTitle("ModCore")
				.WithDescription("A powerful moderating bot written on top of DSharpPlus")
				.AddField("Special thanks to these contributors:",
				"[uwx](https://github.com/uwx)\n" +
				"[jcryer](https://github.com/jcryer)\n" +
				"[Emzi0767](https://github.com/Emzi0767)\n" +
				"[YourAverageBlackGuy](https://github.com/YourAverageBlackGuy)\n" +
				"[DrCreo](https://github.com/DrCreo)\n" +
				"[aexolate](https://github.com/aexolate)\n" +
				"[Drake103](https://github.com/Drake103)\n")
				.AddField("Contribute?", "Contributions are always welcome at our [GitHub repo.](https://github.com/NaamloosDT/ModCore)")
				.WithThumbnailUrl(ctx.Client.CurrentUser.AvatarUrl)
				.Build();

			await ctx.ElevatedRespondAsync(embed: eb);
		}

		[Command("ping"), Description("Check ModCore's API connection status."), CheckDisable]
		public async Task PingAsync(CommandContext ctx)
		{
			await ctx.SafeRespondAsync($"Pong: ({ctx.Client.Ping}) ms.");
		}

		[Command("prefix"), Description("Check ModCore's current prefix."), CheckDisable]
		public async Task PrefixAsync(CommandContext ctx)
		{
			await ctx.IfGuildSettings(
				async (e) => await ctx.SafeRespondAsync($"Current prefix: {e.Prefix}"),
				async () => await ctx.SafeRespondAsync($"Current prefix: {this.Shared.DefaultPrefix}"));
		}

		[Command("uptime"), Description("Check ModCore's uptime."), Aliases("u"), CheckDisable]
		public async Task UptimeAsync(CommandContext ctx)
		{
			var st = this.StartTimes;
			var bup = DateTimeOffset.Now.Subtract(st.ProcessStartTime);
			var sup = DateTimeOffset.Now.Subtract(st.SocketStartTime);

			// Needs improvement
			await ctx.SafeRespondAsync(
				$"Program uptime: {string.Format("{0} days, {1}", bup.ToString("dd"), bup.ToString(@"hh\:mm\:ss"))}\n" +
				$"Socket uptime: {string.Format("{0} days, {1}", sup.ToString("dd"), sup.ToString(@"hh\:mm\:ss"))}");
		}

		[Command("invite"), Description("Get an invite to this ModCore instance. Sharing is caring!"), Aliases("inv"), CheckDisable]
		public async Task InviteAsync(CommandContext ctx)
		{
			//TODO replace with a link to a nice invite builder!
			// what the hell is an invite builder? - chris
			var app = ctx.Client.CurrentApplication;
			if (app.IsPublic != null && (bool)app.IsPublic)
				await ctx.SafeRespondAsync(
					$"Add ModCore to your server!\n<https://modcore.naamloos.me/info/invite>");
			else
				await ctx.SafeRespondAsync("I'm sorry Mario, but this instance of ModCore has been set to private!");
		}

		[Command("ban"), Description("Bans a member."), Aliases("b"), RequirePermissions(Permissions.BanMembers), CheckDisable]
		public async Task BanAsync(CommandContext ctx, [Description("Member to ban")] DiscordMember m,<commit_msg>never pushed these tiny changes<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.CommandsNext.Converters;
using DSharpPlus.Entities;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Enums;
using DSharpPlus.Interactivity.EventHandling;
using Humanizer;
using Humanizer.Localisation;
using ModCore.Database;
using ModCore.Entities;
using ModCore.Listeners;
using ModCore.Logic;
using ModCore.Logic.Extensions;
using ModCore.Logic.Utils;

namespace ModCore.Commands
{
	public class Main : BaseCommandModule
	{
		private static readonly Regex SpaceReplacer = new Regex(" {2,}", RegexOptions.Compiled);

		public SharedData Shared { get; }
		public DatabaseContextBuilder Database { get; }
		public InteractivityExtension Interactivity { get; }
		public StartTimes StartTimes { get; }

		public Main(SharedData shared, DatabaseContextBuilder db, InteractivityExtension interactive,
			StartTimes starttimes)
		{
			this.Database = db;
			this.Shared = shared;
			this.Interactivity = interactive;
			this.StartTimes = starttimes;
		}

		[Command("about"), Description("About this bot.")]
		public async Task AboutAsync(CommandContext ctx)
		{
			var eb = new DiscordEmbedBuilder()
				.WithColor(new DiscordColor("#C1272D"))
				.WithTitle("ModCore")
				.WithDescription("A powerful moderating bot written on top of DSharpPlus")
                .AddField("Main developer", "[Naamloos](https://github.com/Naamloos)")
				.AddField("Special thanks to these contributors:",
				"[uwx](https://github.com/uwx)\n" +
				"[jcryer](https://github.com/jcryer)\n" +
				"[Emzi0767](https://github.com/Emzi0767)\n" +
				"[YourAverageBlackGuy](https://github.com/YourAverageBlackGuy)\n" +
				"[DrCreo](https://github.com/DrCreo)\n" +
				"[aexolate](https://github.com/aexolate)\n" +
				"[Drake103](https://github.com/Drake103)\n")
				.AddField("Contribute?", "Contributions are always welcome at our [GitHub repo.](https://github.com/Naamloos/ModCore)")
				.WithThumbnailUrl(ctx.Client.CurrentUser.AvatarUrl)
				.Build();

			await ctx.ElevatedRespondAsync(embed: eb);
		}

		[Command("ping"), Description("Check ModCore's API connection status."), CheckDisable]
		public async Task PingAsync(CommandContext ctx)
		{
			await ctx.SafeRespondAsync($"Pong: ({ctx.Client.Ping}) ms.");
		}

		[Command("prefix"), Description("Check ModCore's current prefix."), CheckDisable]
		public async Task PrefixAsync(CommandContext ctx)
		{
			await ctx.IfGuildSettings(
				async (e) => await ctx.SafeRespondAsync($"Current prefix: {e.Prefix}"),
				async () => await ctx.SafeRespondAsync($"Current prefix: {this.Shared.DefaultPrefix}"));
		}

		[Command("uptime"), Description("Check ModCore's uptime."), Aliases("u"), CheckDisable]
		public async Task UptimeAsync(CommandContext ctx)
		{
			var st = this.StartTimes;
			var bup = DateTimeOffset.Now.Subtract(st.ProcessStartTime);
			var sup = DateTimeOffset.Now.Subtract(st.SocketStartTime);

			// Needs improvement
			await ctx.SafeRespondAsync(
				$"Program uptime: {string.Format("{0} days, {1}", bup.ToString("dd"), bup.ToString(@"hh\:mm\:ss"))}\n" +
				$"Socket uptime: {string.Format("{0} days, {1}", sup.ToString("dd"), sup.ToString(@"hh\:mm\:ss"))}");
		}

		[Command("invite"), Description("Get an invite to this ModCore instance. Sharing is caring!"), Aliases("inv"), CheckDisable]
		public async Task InviteAsync(CommandContext ctx)
		{
			//TODO replace with a link to a nice invite builder!
			// what the hell is an invite builder? - chris
			var app = ctx.Client.CurrentApplication;
			if (app.IsPublic != null && (bool)app.IsPublic)
				await ctx.SafeRespondAsync(
					$"Add ModCore to your server!\n<https://modcore.naamloos.dev/info/invite>");
			else
				await ctx.SafeRespondAsync("I'm sorry Mario, but this instance of ModCore has been set to private!");
		}

		[Command("ban"), Description("Bans a member."), Aliases("b"), RequirePermissions(Permissions.BanMembers), CheckDisable]
		public async Task BanAsync(CommandContext ctx, [Description("Member to ban")] DiscordMember m,
{'fraction_non_alphanumeric': 0.136783514921838, 'fraction_numerical': 0.005447655139744197, 'mean_word_length': 4.852390852390853, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 19, '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': '627485', 'n_tokens_mistral': 2960, 'n_tokens_neox': 2588, 'n_words': 612}