private Task PullMessage_OnAction(ReadyToVerify arg) { if (arg.JustDeQueue) { FriendListApi.DeclineFriendRequest(arg.EpicId).Wait(); return(Task.CompletedTask); } var spanTime = DateTimeOffset.UtcNow - arg.Expire; if (spanTime.TotalSeconds >= 0 && FriendListApi.IsAuthorized) { try { var usr = DiscordApi.GetApi.GetUserAsync(arg.DiscordUserId.ToUlong()).Result; var channel = (IMessageChannel)DiscordApi.GetApi.GetChannelAsync(arg.ChannelId).Result; IUserMessage msg = null; try { msg = (IUserMessage)channel.GetMessageAsync(arg.MessageId, options: Core.Utils.RequestOption).Result; } catch (Exception e) { return(Task.CompletedTask); } if (usr != null) { FortniteUser dbAccount = Context.FortniteUsers.Find(arg.DiscordUserId); if (dbAccount == null) { msg?.SetErrorAsync()?.Wait(); return(Task.CompletedTask); } var verificationResult = FriendListApi.DeclineFriendRequest(arg.EpicId).Result; if (verificationResult) { if (dbAccount.IsValidName) { dbAccount.VerifiedProfile = true; dbAccount.LastUpDateTime = DateTimeOffset.UtcNow; Context.Entry(dbAccount).State = EntityState.Modified; Context.SaveChanges(); msg?.SetSuccessAsync()?.Wait(); } else { msg?.SetQuestionMarkAsync()?.Wait(); } } else { msg?.SetErrorAsync()?.Wait(); } } else { msg?.SetErrorAsync()?.Wait(); } } catch (Exception e) { throw e; } finally { var verifyFinished = Context.VerifyOrders.Find(arg.EpicId); if (verifyFinished != null) { Context.VerifyOrders.Remove(verifyFinished); Context.SaveChanges(); } } } else { Redis .ListLeftPush(QueueName, arg, flags: CommandFlags.FireAndForget); } return(Task.CompletedTask); }