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 handleButtonEvent _ (event : ComponentInteractionCreateEventArgs) =
|
||||||
let ctx = DiscordEventContext event :> IDiscordContext
|
let ctx = DiscordEventContext event :> IDiscordContext
|
||||||
match event.Id with
|
match event.Id with
|
||||||
| id when id.StartsWith("GimmeWhitelist") ->
|
| id when id.StartsWith("GimmeWhitelist") -> Store.buy "WHITELIST" None ctx
|
||||||
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("Buy") ->
|
| id when id.StartsWith("Buy") ->
|
||||||
task {
|
task {
|
||||||
let id = ctx.GetInteractionId()
|
let id = ctx.GetInteractionId()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user