Skip to content

Commit

Permalink
Don't touch joinwatch notes list if note is empty
Browse files Browse the repository at this point in the history
Avoids creating an empty entry in the list, which breaks the joinwatch embed
  • Loading branch information
FloatingMilkshake committed Oct 18, 2023
1 parent 4a20ddd commit 0784524
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Commands/Lists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public async Task JoinWatch(
{
// User is not joinwatched, watch
await Program.db.ListRightPushAsync("joinWatchedUsers", user.Id);
await Program.db.HashSetAsync("joinWatchedUsersNotes", user.Id, note);
if (note != "")
await Program.db.HashSetAsync("joinWatchedUsersNotes", user.Id, note);
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Now watching for joins/leaves of {user.Mention} to send to the investigations channel"
+ (note == "" ? "!" : $" with the following note:\n>>> {note}"));
}
Expand Down

0 comments on commit 0784524

Please sign in to comment.