Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion DiscordBot/Commands/Admin/AdminListCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Discord.Interactions;
using Discord.WebSocket;

namespace OpenShock.DiscordBot.Commands.Admin;

Expand Down
1 change: 0 additions & 1 deletion DiscordBot/Commands/ControlCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using OneOf.Types;
using OpenShock.DiscordBot.OpenShockDiscordDb;
using OpenShock.DiscordBot.Utils;
using OpenShock.SDK.CSharp;
using OpenShock.SDK.CSharp.Errors;
using OpenShock.SDK.CSharp.Models;

Expand Down
5 changes: 2 additions & 3 deletions DiscordBot/Commands/Profanity/ProfanityListCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Discord;
using Discord.Interactions;
using Microsoft.EntityFrameworkCore;
using OpenShock.DiscordBot.OpenShockDiscordDb;

namespace OpenShock.DiscordBot.Commands.Profanity;

Expand All @@ -12,8 +11,8 @@ public async Task ProfanityListCommand()
{
await DeferAsync(ephemeral: true);

var rules = await Queryable
.OrderByDescending<ProfanityRule, DateTimeOffset>(_db.ProfanityRules, r => r.CreatedAt)
var rules = await _db.ProfanityRules
.OrderByDescending(r => r.CreatedAt)
.Take(10)
.ToListAsync();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Text;
using Discord.Interactions;
using Microsoft.EntityFrameworkCore;
using OpenShock.DiscordBot.OpenShockDiscordDb;

namespace OpenShock.DiscordBot.Commands.ProfanityAdmin;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Discord;
using Discord.Interactions;
using Microsoft.EntityFrameworkCore;
using OpenShock.DiscordBot.OpenShockDiscordDb;

namespace OpenShock.DiscordBot.Commands.ProfanityAdmin;

Expand Down
2 changes: 1 addition & 1 deletion DiscordBot/Commands/Setup/SetupConnectionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task ExecuteSetupCommand()
ApiToken = user.ApiKey,
ApiServer = user.ApiServer
};
await Context.Interaction.RespondWithModalAsync<SetupModal>(SetupModalId, previousData);
await Context.Interaction.RespondWithModalAsync(SetupModalId, previousData);
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic type parameter was removed from RespondWithModalAsync, but line 23 in the same file still uses RespondWithModalAsync<SetupModal>. This inconsistency suggests either: 1) line 23 should also be updated to remove the generic parameter, or 2) this change may be incorrect. Please ensure both calls use the same API pattern.

Copilot uses AI. Check for mistakes.
}

// Responds to the modal.
Expand Down
29 changes: 14 additions & 15 deletions DiscordBot/DiscordBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Company>OpenShock</Company>
Expand All @@ -13,32 +13,31 @@
<AssemblyName>OpenShock.DiscordBot</AssemblyName>
<RootNamespace>OpenShock.DiscordBot</RootNamespace>
<InvariantGlobalization>false</InvariantGlobalization>
<LangVersion>13</LangVersion>
<UserSecretsId>05918ba7-2547-4661-9c92-1172d1441505</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Discord.Addons.Hosting" Version="6.1.0" />
<PackageReference Include="Discord.Net" Version="3.18.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="9.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="9.0.10" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="10.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
<PackageReference Include="OneOf" Version="3.0.271" />
<PackageReference Include="OpenShock.SDK.CSharp" Version="0.0.39" />
<PackageReference Include="OpenShock.SDK.CSharp" Version="0.0.40" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Extensions.Autofac.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
Expand All @@ -49,7 +48,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<None Remove="appsettings.json" />
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
9 changes: 4 additions & 5 deletions DiscordBot/MessageHandler/MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
using OpenShock.DiscordBot.OpenShockDiscordDb;
using OpenShock.DiscordBot.Services;
using OpenShock.DiscordBot.Services.ProfanityDetector;
using OpenShock.DiscordBot.Utils;
using OpenShock.SDK.CSharp.Models;

namespace OpenShock.DiscordBot;
namespace OpenShock.DiscordBot.MessageHandler;

public sealed partial class MessageHandler
{
Expand Down Expand Up @@ -77,9 +76,9 @@ public async Task HandleMessageAsync(SocketMessage message)

// Send reaction and trigger shock
await Task.WhenAll([
message.AddReactionAsync(new Emoji("⚡")),
ShockUserAsync(scope, authorDiscordId, intensityPercent)
]);
message.AddReactionAsync(new Emoji("⚡")),
ShockUserAsync(scope, authorDiscordId, intensityPercent)
]);
}
}
}
5 changes: 1 addition & 4 deletions DiscordBot/OpenShockDiscordDb/BotAdmin.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;

namespace OpenShock.DiscordBot.OpenShockDiscordDb;
namespace OpenShock.DiscordBot.OpenShockDiscordDb;

public partial class BotAdmin
{
Expand Down
4 changes: 1 addition & 3 deletions DiscordBot/OpenShockDiscordDb/OpenShockDiscordContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace OpenShock.DiscordBot.OpenShockDiscordDb;

Expand Down
5 changes: 1 addition & 4 deletions DiscordBot/OpenShockDiscordDb/User.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;

namespace OpenShock.DiscordBot.OpenShockDiscordDb;
namespace OpenShock.DiscordBot.OpenShockDiscordDb;

public partial class User
{
Expand Down
5 changes: 1 addition & 4 deletions DiscordBot/OpenShockDiscordDb/UsersFriendwhitelist.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;

namespace OpenShock.DiscordBot.OpenShockDiscordDb;
namespace OpenShock.DiscordBot.OpenShockDiscordDb;

public partial class UsersFriendwhitelist
{
Expand Down
5 changes: 1 addition & 4 deletions DiscordBot/OpenShockDiscordDb/UsersShocker.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;

namespace OpenShock.DiscordBot.OpenShockDiscordDb;
namespace OpenShock.DiscordBot.OpenShockDiscordDb;

public partial class UsersShocker
{
Expand Down
4 changes: 2 additions & 2 deletions DiscordBot/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using Discord;
using Discord;
using Discord.Interactions;
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
Expand All @@ -13,6 +12,7 @@
using OpenShock.DiscordBot.Utils;
using Serilog;
using System.Reflection;
using OpenShock.DiscordBot.MessageHandler;
using OpenShock.DiscordBot.Services.ProfanityDetector;

try
Expand Down
1 change: 0 additions & 1 deletion DiscordBot/Services/InteractionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Discord.WebSocket;
using Microsoft.Extensions.Logging;
using OpenShock.DiscordBot.Utils;
using Serilog;

namespace OpenShock.DiscordBot.Services;

Expand Down
4 changes: 1 addition & 3 deletions DiscordBot/Services/OpenShockBackendService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Discord;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using OpenShock.DiscordBot.OpenShockDiscordDb;
using OpenShock.DiscordBot.Utils;
using OpenShock.SDK.CSharp;
using OpenShock.SDK.CSharp.Models;

namespace OpenShock.DiscordBot.Services;
Expand Down
3 changes: 1 addition & 2 deletions DiscordBot/Utils/ApiUtils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Discord;
using OpenShock.DiscordBot.OpenShockDiscordDb;
using OpenShock.DiscordBot.OpenShockDiscordDb;
using OpenShock.SDK.CSharp;

namespace OpenShock.DiscordBot.Utils;
Expand Down
1 change: 0 additions & 1 deletion DiscordBot/Utils/DiscordUtils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Discord;
using Discord.Interactions;

namespace OpenShock.DiscordBot.Utils;

Expand Down
4 changes: 1 addition & 3 deletions DiscordBot/Utils/Embeds.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;
using Discord;
using OpenShock.DiscordBot.Commands;
using Discord;

namespace OpenShock.DiscordBot.Utils;

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
WORKDIR /src
COPY *.slnx .
COPY DiscordBot/*.csproj ./DiscordBot/
Expand All @@ -9,7 +9,7 @@ COPY . .
RUN dotnet publish -c Release -o /publish --no-restore


FROM mcr.microsoft.com/dotnet/runtime:9.0-alpine
FROM mcr.microsoft.com/dotnet/runtime:10.0-alpine
WORKDIR /app

ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
Expand Down
12 changes: 6 additions & 6 deletions MigrationHelper/MigrationHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "10.0.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
Loading