Cleaned up code

This commit is contained in:
Tom
2024-08-14 18:19:18 +00:00
parent 36ae613736
commit 9fd43502f5
7 changed files with 13 additions and 183 deletions

View File

@ -44,9 +44,9 @@ namespace TwitchChatTTS.Twitch.Socket.Handlers
_messageTypes.Add("channel.subscription.gift", typeof(ChannelSubscriptionGiftMessage));
}
public async Task Execute(TwitchWebsocketClient sender, object data)
public Task Execute(TwitchWebsocketClient sender, object data)
{
Task.Run(async () =>
return Task.Run(() =>
{
if (sender == null)
return;
@ -66,6 +66,7 @@ namespace TwitchChatTTS.Twitch.Socket.Handlers
}
var d = JsonSerializer.Deserialize(message.Event.ToString()!, type, _options);
ArgumentNullException.ThrowIfNull(d);
Task.Run(async () => await handler.Execute(sender, d));
});
}