From 18735fda2de7e79d57b6dbd6471e1b9c509b8512 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 6 Mar 2022 15:02:20 +0700 Subject: [PATCH] More small changes --- Bot/InviteTracker.fs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index c723ade..0ec2e79 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -111,10 +111,11 @@ let createGuildInvite (ctx : IDiscordContext) = let embed = DiscordEmbedBuilder() - .WithDescription($"Use this invite link to earn invite points for future rewards.\nExpires in 1 day. - ```https://discord.gg/{invite.Code}```") + .WithDescription($"Copy this link and share it with any Degenz you want to recruit to the Degenz Army.\n\n" + + "**YOUR REWARD:** Recruit `10` people and gain access to Beautopia©" + + $"```https://discord.gg/{invite.Code}```") .WithImageUrl("https://pbs.twimg.com/profile_banners/1449270642340089856/1640071520/1500x500") - .WithTitle("Invite Link") + .WithTitle("Your mission") let msg = DiscordInteractionResponseBuilder() @@ -146,15 +147,15 @@ let getAttributions (ctx : IDiscordContext) userId = task { do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg) } -let getInvitedUsersForId (ctx : IDiscordContext) userId = task { - let! users = getInvitedUsers(userId) +let getInvitedUsersForId (ctx : IDiscordContext) = task { + let! users = getInvitedUsers(ctx.GetDiscordMember().Id) let sb = StringBuilder() for user in users do sb.AppendLine($"<@{user}>") |> ignore let msg = DiscordInteractionResponseBuilder() .AsEphemeral(true) - .WithContent($"<@{userId}> has invited the following people:\n{sb}") + .WithContent($"<@{ctx.GetDiscordMember().Id}> has invited the following people:\n{sb}") do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg) } @@ -188,23 +189,23 @@ let handleGuildMemberRemoved _ (eventArgs : GuildMemberRemoveEventArgs) = type Inviter() = inherit ApplicationCommandModule () - [] + [] member this.CreateInvite (ctx : InteractionContext) = createGuildInvite (DiscordInteractionContext ctx) - [] + [] + member this.ListInvitedPeople (ctx : InteractionContext) = + getInvitedUsersForId (DiscordInteractionContext ctx) + +// [] member this.ListServerInvites (ctx : InteractionContext) = listServerInvites (DiscordInteractionContext ctx) - [] +// [] member this.getAttributions (ctx : InteractionContext, [] user : DiscordUser) = getAttributions (DiscordInteractionContext ctx) user.Id - [] - member this.ListInvitedPeople (ctx : InteractionContext, [] user : DiscordUser) = - getInvitedUsersForId (DiscordInteractionContext ctx) user.Id - - [] +// [] member this.ClearInvites (ctx : InteractionContext) = clearInvites (DiscordInteractionContext ctx)