Skip to content

Commit d5743ba

Browse files
committed
fix: fix mention in /rule
1 parent 044dc97 commit d5743ba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Hammer/Commands/Rules/RuleCommand.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ public async Task RuleAsync(InteractionContext context,
6868
embed.WithTitle(string.IsNullOrWhiteSpace(rule.Brief) ? $"Rule #{rule.Id}" : $"Rule #{rule.Id}. {rule.Brief}");
6969
embed.WithDescription(rule.Description);
7070

71-
await context.CreateResponseAsync(mentionUser?.Mention, embed).ConfigureAwait(false);
71+
var response = new DiscordInteractionResponseBuilder();
72+
response.AddEmbed(embed);
73+
74+
if (mentionUser is not null)
75+
{
76+
response.WithContent(mentionUser.Mention);
77+
response.AddMention(new UserMention(mentionUser.Id));
78+
}
79+
80+
await context.CreateResponseAsync(response).ConfigureAwait(false);
7281
}
7382
}

0 commit comments

Comments
 (0)