Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9a6431a
update Remora
TraceLD Sep 30, 2022
5201c86
use the new way to build the command tree
TraceLD Sep 30, 2022
62b4037
.NET 7.0 LETS FUUUUUCKING GOOOOOOOOOOOOOOOOOOOOO
TraceLD Sep 30, 2022
04ded19
finish proof of concept interaction
TraceLD Oct 1, 2022
67fb479
commit this work before uberest v2
TraceLD Oct 22, 2022
1b288bb
fixing missing interaction conditions
TraceLD Nov 7, 2022
9bca444
rework the help system
TraceLD Nov 7, 2022
422512d
fix System.InvalidOperationException: Unable to resolve service for t…
TraceLD Nov 7, 2022
c137f93
fix messed up error in !help when a category could not be matched
TraceLD Nov 7, 2022
9f3d94c
fix circular dependency mud
TraceLD Nov 7, 2022
b389864
C# 11
TraceLD Nov 12, 2022
9c9e5f4
stash changes before going to Poland
TraceLD Dec 22, 2022
88f75ff
stash work
TraceLD Mar 24, 2023
109b26c
add notifications system
TraceLD Mar 31, 2023
04d3c90
port GeneralModerationCommands to new notifications system
TraceLD Mar 31, 2023
c5d38b1
bump packages
TraceLD Apr 3, 2023
9c20451
Port Diagnostics and Guilds features to the new View-based GUI system
TraceLD Apr 3, 2023
cffdae6
Clean up code
TraceLD Apr 3, 2023
cf95f24
port more commands to the new system
TraceLD Apr 27, 2023
048557a
Add a working Discord command generator
TraceLD May 13, 2023
2e14555
Add working Remora conditions copying
TraceLD May 14, 2023
a830a35
Fix a bunch of issues with the Discord commands source generator
TraceLD May 14, 2023
c735e2a
Clean up the Discord command source generator
TraceLD May 14, 2023
8ed902c
Formatting fix
TraceLD May 14, 2023
f18c2ff
Formatting fix
TraceLD May 14, 2023
3a2e4c7
Formatting fix
TraceLD May 14, 2023
e91eda2
Fix issues with nullability in Discord command source generator
TraceLD May 14, 2023
e406e9e
Add porbeagle submodule
TraceLD Jul 1, 2023
2c0224b
use the new porbeagle paths
TraceLD Jul 1, 2023
b811752
working source gen
TraceLD Aug 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "src/Mmcc.Bot.Polychat/Protos"]
path = src/Mmcc.Bot.Polychat/Protos
url = https://github.com/ModdedMinecraftClub/protos
[submodule "src/porbeagle"]
path = src/porbeagle
url = https://github.com/TraceLD/porbeagle
84 changes: 0 additions & 84 deletions src/Mmcc.Bot.Caching/ButtonHandlerRepository.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/Mmcc.Bot.Caching/CachingSetup.cs

This file was deleted.

12 changes: 0 additions & 12 deletions src/Mmcc.Bot.Caching/Entities/ButtonHandler.cs

This file was deleted.

37 changes: 0 additions & 37 deletions src/Mmcc.Bot.Caching/Entities/HandleableButton.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Mmcc.Bot.Common.Extensions/Caching/ButtonExtensions.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ public static IEnumerable<EmbedField> GetEmbedFields(this IEnumerable<Moderation
return new[] {warningsField, mutesField, bansField};
}

public static string GetUserDataDisplayString(this ModerationAction ma)
=> ma switch
{
{ UserDiscordId: { } dId, UserIgn: { } ign } =>
$$"""
Discord user: <@{{dId}}>
IGN: `{{ign}}`
""",

{ UserDiscordId: { } dId } => $"Discord user: <@{dId}>",

{ UserIgn: { } ign } => $"IGN: `{ign}`",

_ => "No Discord ID/IGN data."
};

private static EmbedField GetEmbedFieldForActionsOfType(this IEnumerable<ModerationAction> moderationActions, ModerationActionType type, bool showAssociatedDiscord, bool showAssociatedIgn)
{
var list = moderationActions.Where(ma => ma.ModerationActionType == type).ToList();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using System;
using FluentValidation;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -33,6 +34,11 @@ IConfigurationSection configurationSection
where TValidator : AbstractValidator<TConfig>, new()
{
var config = configurationSection.Get<TConfig>();
if (config is null)
{
throw new Exception($"Could not match a configuration section to {typeof(TConfig)}");
}

var validator = new TValidator();

validator.ValidateAndThrow(config);
Expand Down
10 changes: 4 additions & 6 deletions src/Mmcc.Bot.Common.Extensions/Mmcc.Bot.Common.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Mmcc.Bot.Caching\Mmcc.Bot.Caching.csproj" />
<ProjectReference Include="..\Mmcc.Bot.Common\Mmcc.Bot.Common.csproj" />
<ProjectReference Include="..\Mmcc.Bot.Database\Mmcc.Bot.Database.csproj" />
<ProjectReference Include="..\Mmcc.Bot.Mojang\Mmcc.Bot.Mojang.csproj" />
<ProjectReference Include="..\Mmcc.Bot.RemoraAbstractions\Mmcc.Bot.RemoraAbstractions.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="10.3.3" />
<PackageReference Include="Remora.Discord" Version="2022.3.0" />
<PackageReference Include="FluentValidation" Version="11.2.2" />
<PackageReference Include="Remora.Discord" Version="2022.48.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static async Task<Result<IChannel>> FindGuildChannelByName(this IDiscordR
var guildChannels = getGuildChannelsResult.Entity;
var channel = guildChannels
.Where(c => c.Name.HasValue)
.FirstOrDefault(c => c.Name.Value.Equals(channelName));
.FirstOrDefault(c => c.Name.Value!.Equals(channelName));
if (channel is null)
{
return new NotFoundError(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Linq;
using Remora.Discord.API.Abstractions.Objects;
using Remora.Discord.API.Objects;

namespace Mmcc.Bot.Common.Extensions.System;

public static class KeyValuePairDiscordExtensions
{
public static IEnumerable<IEmbedField> ToEmbedFields(this IEnumerable<KeyValuePair<string, string>> kvEnumerable)
=> kvEnumerable.Select(x => new EmbedField(x.Key, x.Value, false));

public static EmbedField ToEmbedField(this KeyValuePair<string, string> kv)
=> new(kv.Key, kv.Value, false);
}
Loading