Skip to content

Commit

Permalink
Fix crash on empty tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Nov 15, 2024
1 parent 19ac552 commit b1d30f1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Sanara/Module/Command/Impl/Doujin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,21 @@ public async Task AdultVideoAsync(IContext ctx)
}
if (name.Length > 256) name = name[..255] + "";

List<EmbedFieldBuilder> fields = new();
if (tags.Any())
{
fields.Add(new EmbedFieldBuilder()
.WithName("Tags")
.WithValue(string.Join(", ", tags)));
}

var embed = new EmbedBuilder()
.WithColor(Color.Blue)
.WithTitle(name)
.WithUrl(finalUrl)
.WithImageUrl(image)
.WithDescription(description)
.WithFields(
new EmbedFieldBuilder()
.WithName("Tags")
.WithValue(string.Join(", ", tags))
);
.WithFields([.. fields]);

await ctx.ReplyAsync(embed: embed.Build());
}
Expand Down

0 comments on commit b1d30f1

Please sign in to comment.