Skip to content

Commit

Permalink
Add URL checks to reverse image search commands
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 committed Mar 3, 2024
1 parent 0ed346e commit 0c18698
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Modules/ImageModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ public async Task<RuntimeResult> ReverseAsync([Summary(description: "The URL of
public async Task<RuntimeResult> ReverseAsync(string url, ReverseImageSearchEngine engine, bool multiImages,
IDiscordInteraction interaction, IDiscordInteraction? originalInteraction = null, bool ephemeral = false)
{
if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
{
return FergunResult.FromError(_localizer["UrlNotWellFormed"], true, interaction);
}

_logger.LogDebug("Performing reverse image search (engine: {Engine}, multi-images: {MultiImages}, ephemeral: {Ephemeral})", engine, multiImages, ephemeral);

return engine switch
Expand Down

0 comments on commit 0c18698

Please sign in to comment.