Refactor Sentry scope enrichment
This commit is contained in:
@@ -10,25 +10,14 @@ namespace PluralKit.Bot
|
||||
public class ReactionAdded: IEventHandler<MessageReactionAddEventArgs>
|
||||
{
|
||||
private readonly ProxyService _proxy;
|
||||
private readonly Scope _sentryScope;
|
||||
|
||||
public ReactionAdded(ProxyService proxy, Scope sentryScope)
|
||||
public ReactionAdded(ProxyService proxy)
|
||||
{
|
||||
_proxy = proxy;
|
||||
_sentryScope = sentryScope;
|
||||
}
|
||||
|
||||
public Task Handle(MessageReactionAddEventArgs evt)
|
||||
{
|
||||
_sentryScope.AddBreadcrumb("", "event.reaction", data: new Dictionary<string, string>()
|
||||
{
|
||||
{"user", evt.User.Id.ToString()},
|
||||
{"channel", (evt.Channel?.Id ?? 0).ToString()},
|
||||
{"guild", (evt.Channel?.GuildId ?? 0).ToString()},
|
||||
{"message", evt.Message.Id.ToString()},
|
||||
{"reaction", evt.Emoji.Name}
|
||||
});
|
||||
_sentryScope.SetTag("shard", evt.Client.ShardId.ToString());
|
||||
return _proxy.HandleReactionAddedAsync(evt);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user