Skip to content

Commit

Permalink
remove Modrinth Helper, rely on Modrinth.Net library
Browse files Browse the repository at this point in the history
  • Loading branch information
Zechiax committed Apr 15, 2023
1 parent d7c5f5d commit 16c79be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 67 deletions.
25 changes: 0 additions & 25 deletions Asterion.Test/TestHelper.cs

This file was deleted.

8 changes: 3 additions & 5 deletions Asterion/Services/MessageHandler.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.Reflection;
using Asterion.Interfaces;
using Asterion.Services.Modrinth;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Modrinth.Helpers;

namespace Asterion.Services;

Expand All @@ -16,14 +16,12 @@ public class MessageHandler
private readonly ILogger<MessageHandler> _logger;
private readonly IServiceProvider _services;
private readonly DiscordSocketClient _client;
private readonly ModrinthHelper _helper;

public MessageHandler(IServiceProvider services, ILogger<MessageHandler> logger)
{
_services = services;
_logger = logger;

_helper = new ModrinthHelper();

_dataService = services.GetRequiredService<IDataService>();
_client = services.GetRequiredService<DiscordSocketClient>();
_commands = services.GetRequiredService<CommandService>();
Expand Down Expand Up @@ -59,7 +57,7 @@ private async Task MessageReceivedAsync(SocketMessage rawMessage)

var context = new SocketCommandContext(_client, message);

if (_helper.TryParseProjectSlugOrId(rawMessage.CleanContent, out var slugOrId))
if (UrlParser.TryParseModrinthUrl(rawMessage.CleanContent, out var slugOrId))
{
_logger.LogDebug("Found Modrinth link, message id: {MessageId}; parsed ID: {ProjectId}", rawMessage.Id, slugOrId);

Expand Down
37 changes: 0 additions & 37 deletions Asterion/Services/Modrinth/ModrinthHelper.cs

This file was deleted.

0 comments on commit 16c79be

Please sign in to comment.