Dont check invites on button click
This commit is contained in:
		
							parent
							
								
									b08426001a
								
							
						
					
					
						commit
						73ce6c08f1
					
				| @ -61,28 +61,7 @@ let grantWhitelistRole isOg (ctx : IDiscordContext) = | ||||
| let handleButtonEvent _ (event : ComponentInteractionCreateEventArgs) = | ||||
|     let ctx = DiscordEventContext event :> IDiscordContext | ||||
|     match event.Id with | ||||
|     | id when id.StartsWith("GimmeWhitelist") -> | ||||
|         task { | ||||
|             let builder = DiscordInteractionResponseBuilder().AsEphemeral(true).WithContent("Content") | ||||
|             do! ctx.Respond(InteractionResponseType.DeferredChannelMessageWithSource, builder) |> Async.AwaitTask | ||||
|             let! invites = InviteTracker.getInvitedUserCount (ctx.GetDiscordMember().Id) | ||||
|             if invites > 0 then | ||||
|                 let! playerResult = DbService.tryFindPlayer (ctx.GetDiscordMember().Id) | ||||
|                 match playerResult with | ||||
|                 | Some player -> do! Store.buyForPlayer "WHITELIST" player None ctx |> Async.StartAsTask | ||||
|                 | None -> do! Messaging.sendFollowUpMessage ctx "You are currently not a hacker, first use the /redpill command to become one" | ||||
|             else | ||||
|                 let builder = DiscordFollowupMessageBuilder().AsEphemeral(true) | ||||
|                 builder.Content <- $""" | ||||
| ❌ **Degen**, can’t you **READ**?! | ||||
| ⚠️ **__Requirements:__** 1x Invited User | ||||
| 
 | ||||
| To BUY Whitelist you must have **__INVITED__** 1 Degen. | ||||
| ☑️  Go to <#{GuildEnvironment.channelRecruitment}> | ||||
| ☑️  Invite just 1 Degen! | ||||
| """ | ||||
|                 do! ctx.FollowUp(builder) | ||||
|         } :> Task | ||||
|     | id when id.StartsWith("GimmeWhitelist") -> Store.buy "WHITELIST" None ctx | ||||
|     | id when id.StartsWith("Buy") -> | ||||
|         task { | ||||
|             let id = ctx.GetInteractionId() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user