Use same recruited embed

This commit is contained in:
Joseph Ferano 2022-04-05 12:52:00 +07:00
parent e645b2fabd
commit 0e77c26b82
2 changed files with 24 additions and 23 deletions

View File

@ -17,7 +17,7 @@ type AdminBot() =
[<SlashCommand("admin-invites", "Get total invites from a specific user")>] [<SlashCommand("admin-invites", "Get total invites from a specific user")>]
member this.GetAttributions (ctx : InteractionContext, [<Option("player", "The player you want to check")>] user : DiscordUser) = member this.GetAttributions (ctx : InteractionContext, [<Option("player", "The player you want to check")>] user : DiscordUser) =
enforceAdmin (DiscordInteractionContext ctx) (InviteTracker.getAttributions user.Id) enforceAdmin (DiscordInteractionContext ctx) (InviteTracker.getInvitedUsersForId)
[<SlashCommand("admin-whitelist-stock", "Set whitelist stock")>] [<SlashCommand("admin-whitelist-stock", "Set whitelist stock")>]
member this.SetStock (ctx : InteractionContext, [<Option("amount", "Set the amount of WL available for purchase")>] amount : int64) = member this.SetStock (ctx : InteractionContext, [<Option("amount", "Set the amount of WL available for purchase")>] amount : int64) =

View File

@ -242,7 +242,8 @@ let getAttributions userId (ctx : IDiscordContext) =
do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg) do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg)
} :> Task } :> Task
let private getInvitedUsersForId (ctx : IDiscordContext) = task { let getInvitedUsersForId (ctx : IDiscordContext) =
task {
let! users = getInvitedUsers (ctx.GetDiscordMember().Id) let! users = getInvitedUsers (ctx.GetDiscordMember().Id)
let! total = getInvitedUserCount (ctx.GetDiscordMember().Id) let! total = getInvitedUserCount (ctx.GetDiscordMember().Id)
let sb = StringBuilder() let sb = StringBuilder()
@ -263,7 +264,7 @@ let private getInvitedUsersForId (ctx : IDiscordContext) = task {
let user = ctx.GetDiscordMember() let user = ctx.GetDiscordMember()
let channel = ctx.GetChannel() let channel = ctx.GetChannel()
do! Analytics.recruitedCommand total user.Id user.Username channel do! Analytics.recruitedCommand total user.Id user.Username channel
} } :> Task
let clearInvites (ctx : IDiscordContext) = task { let clearInvites (ctx : IDiscordContext) = task {
let! invites = ctx.GetGuild().GetInvitesAsync() let! invites = ctx.GetGuild().GetInvitesAsync()