Grant OG Whitelist role
This commit is contained in:
parent
4615aa3493
commit
bdbb074383
@ -54,6 +54,7 @@ let roleTrainee = getId "ROLE_TRAINEE"
|
||||
let roleHacker = getId "ROLE_HACKER"
|
||||
let rolePrisoner = getId "ROLE_PRISONER"
|
||||
let roleWhitelist = getId "ROLE_WHITELIST"
|
||||
let roleWhiteOG = getId "ROLE_WHITEOG"
|
||||
let roleAdmin = getId "ROLE_ADMIN"
|
||||
let mutable botClientRecruit : DiscordClient option = None
|
||||
let mutable botClientHacker : DiscordClient option = None
|
||||
|
@ -42,9 +42,10 @@ You need to **BUY** Whitelist with 💰 $GBT...
|
||||
printfn $"Error trying to get channel Whitelist\n\n{e.Message}"
|
||||
} |> Async.RunSynchronously
|
||||
|
||||
let grantWhitelistRole (ctx : IDiscordContext) =
|
||||
let grantWhitelistRole isOg (ctx : IDiscordContext) =
|
||||
task {
|
||||
let role = ctx.GetGuild().GetRole(GuildEnvironment.roleWhitelist)
|
||||
let roleId = if isOg then GuildEnvironment.roleWhiteOG else GuildEnvironment.roleWhitelist
|
||||
let role = ctx.GetGuild().GetRole(roleId)
|
||||
do! ctx.GetDiscordMember().GrantRoleAsync(role)
|
||||
} :> Task
|
||||
|
||||
@ -57,7 +58,7 @@ let handleButtonEvent _ (event : ComponentInteractionCreateEventArgs) =
|
||||
let id = ctx.GetInteractionId()
|
||||
let itemId = id.Split("-").[1]
|
||||
do! Store.handleBuyItem ctx itemId
|
||||
do! grantWhitelistRole ctx
|
||||
do! grantWhitelistRole (itemId = "WHITEOG") ctx
|
||||
} :> Task
|
||||
| id when id.StartsWith("CreateGuildInvite") -> InviteTracker.handleCreateInvite ctx
|
||||
| id when id.StartsWith("ShowRecruited") -> InviteTracker.getInvitedUsersForId (ctx.GetDiscordMember()) ctx
|
||||
|
Loading…
x
Reference in New Issue
Block a user