Skip to content

Commit

Permalink
Adds tag edit as a text alias to tag update; Fixes tag update f…
Browse files Browse the repository at this point in the history
…rom breaking due to not passing `uses` to the prepared command
  • Loading branch information
OoLunar committed Oct 7, 2024
1 parent ddb3edc commit f7de8da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Commands/Common/TagCommand/TagCommand.Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using DSharpPlus;
using DSharpPlus.Commands;
using DSharpPlus.Commands.ArgumentModifiers;
using DSharpPlus.Commands.Trees.Metadata;
using OoLunar.Tomoe.Database.Models;

namespace OoLunar.Tomoe.Commands.Common
Expand All @@ -13,7 +14,7 @@ public sealed partial class TagCommand
/// </summary>
/// <param name="name">The name of the tag to update.</param>
/// <param name="content">The new content that the text wall should contain.</param>
[Command("update")]
[Command("update"), TextAlias("edit")]
public static async ValueTask UpdateTagAsync(CommandContext context, string name, [RemainingText] string content)
{
if (!TryVerifyTagName(await context.GetCultureAsync(), ref name, out string? error))
Expand Down
1 change: 1 addition & 0 deletions src/Database/Models/TagHistoryModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static async ValueTask CreateRevisionAsync(TagModel tag)
_newRevision.Parameters["@owner_id"].Value = (long)tag.OwnerId;
_newRevision.Parameters["@guild_id"].Value = (long)tag.GuildId;
_newRevision.Parameters["@last_updated_at"].Value = DateTime.UtcNow;
_newRevision.Parameters["@uses"].Value = (long)tag.Uses;

await _newRevision.ExecuteNonQueryAsync();
}
Expand Down

0 comments on commit f7de8da

Please sign in to comment.