More small changes

This commit is contained in:
Joseph Ferano 2022-03-06 15:02:20 +07:00
parent 289d9e3817
commit 18735fda2d

View File

@ -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 ()
[<SlashCommand("invite-create", "Invite user to this discord and earn rewards")>]
[<SlashCommand("recruit", "Recruit another user to this discord and earn rewards")>]
member this.CreateInvite (ctx : InteractionContext) =
createGuildInvite (DiscordInteractionContext ctx)
[<SlashCommand("invites-list", "List all the invites")>]
[<SlashCommand("recruited", "Get total invites from a specific user")>]
member this.ListInvitedPeople (ctx : InteractionContext) =
getInvitedUsersForId (DiscordInteractionContext ctx)
// [<SlashCommand("invites-list", "List all the invites")>]
member this.ListServerInvites (ctx : InteractionContext) =
listServerInvites (DiscordInteractionContext ctx)
[<SlashCommand("invites-attributions", "Get total invites from a specific user")>]
// [<SlashCommand("invites-attributions", "Get total invites from a specific user")>]
member this.getAttributions (ctx : InteractionContext, [<Option("player", "The player you want to check")>] user : DiscordUser) =
getAttributions (DiscordInteractionContext ctx) user.Id
[<SlashCommand("invited-people", "Get total invites from a specific user")>]
member this.ListInvitedPeople (ctx : InteractionContext, [<Option("player", "The player you want to check")>] user : DiscordUser) =
getInvitedUsersForId (DiscordInteractionContext ctx) user.Id
[<SlashCommand("invites-clear", "Get total invites from a specific user")>]
// [<SlashCommand("invites-clear", "Get total invites from a specific user")>]
member this.ClearInvites (ctx : InteractionContext) =
clearInvites (DiscordInteractionContext ctx)