diff --git a/PluralKit.Bot/CommandSystem/Context.cs b/PluralKit.Bot/CommandSystem/Context.cs index 66ad6574..51385ae6 100644 --- a/PluralKit.Bot/CommandSystem/Context.cs +++ b/PluralKit.Bot/CommandSystem/Context.cs @@ -1,8 +1,9 @@ using System; using System.Threading.Tasks; +using App.Metrics; + using Discord; -using Discord.Net; using Discord.WebSocket; using Microsoft.Extensions.DependencyInjection; @@ -19,6 +20,7 @@ namespace PluralKit.Bot.CommandSystem private readonly IDataStore _data; private readonly PKSystem _senderSystem; + private readonly IMetrics _metrics; private Command _currentCommand; @@ -29,6 +31,7 @@ namespace PluralKit.Bot.CommandSystem _message = message; _data = provider.GetRequiredService(); _senderSystem = senderSystem; + _metrics = provider.GetRequiredService(); _provider = provider; _parameters = new Parameters(message.Content.Substring(commandParseOffset)); } @@ -75,6 +78,7 @@ namespace PluralKit.Bot.CommandSystem try { await handler(_provider.GetRequiredService()); + _metrics.Measure.Meter.Mark(BotMetrics.CommandsRun); } catch (PKSyntaxError e) {