More small changes
This commit is contained in:
parent
289d9e3817
commit
18735fda2d
@ -111,10 +111,11 @@ let createGuildInvite (ctx : IDiscordContext) =
|
|||||||
|
|
||||||
let embed =
|
let embed =
|
||||||
DiscordEmbedBuilder()
|
DiscordEmbedBuilder()
|
||||||
.WithDescription($"Use this invite link to earn invite points for future rewards.\nExpires in 1 day.
|
.WithDescription($"Copy this link and share it with any Degenz you want to recruit to the Degenz Army.\n\n" +
|
||||||
```https://discord.gg/{invite.Code}```")
|
"**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")
|
.WithImageUrl("https://pbs.twimg.com/profile_banners/1449270642340089856/1640071520/1500x500")
|
||||||
.WithTitle("Invite Link")
|
.WithTitle("Your mission")
|
||||||
|
|
||||||
let msg =
|
let msg =
|
||||||
DiscordInteractionResponseBuilder()
|
DiscordInteractionResponseBuilder()
|
||||||
@ -146,15 +147,15 @@ let getAttributions (ctx : IDiscordContext) userId = task {
|
|||||||
do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg)
|
do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
let getInvitedUsersForId (ctx : IDiscordContext) userId = task {
|
let getInvitedUsersForId (ctx : IDiscordContext) = task {
|
||||||
let! users = getInvitedUsers(userId)
|
let! users = getInvitedUsers(ctx.GetDiscordMember().Id)
|
||||||
let sb = StringBuilder()
|
let sb = StringBuilder()
|
||||||
for user in users do
|
for user in users do
|
||||||
sb.AppendLine($"<@{user}>") |> ignore
|
sb.AppendLine($"<@{user}>") |> ignore
|
||||||
let msg =
|
let msg =
|
||||||
DiscordInteractionResponseBuilder()
|
DiscordInteractionResponseBuilder()
|
||||||
.AsEphemeral(true)
|
.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)
|
do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,23 +189,23 @@ let handleGuildMemberRemoved _ (eventArgs : GuildMemberRemoveEventArgs) =
|
|||||||
type Inviter() =
|
type Inviter() =
|
||||||
inherit ApplicationCommandModule ()
|
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) =
|
member this.CreateInvite (ctx : InteractionContext) =
|
||||||
createGuildInvite (DiscordInteractionContext ctx)
|
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) =
|
member this.ListServerInvites (ctx : InteractionContext) =
|
||||||
listServerInvites (DiscordInteractionContext ctx)
|
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) =
|
member this.getAttributions (ctx : InteractionContext, [<Option("player", "The player you want to check")>] user : DiscordUser) =
|
||||||
getAttributions (DiscordInteractionContext ctx) user.Id
|
getAttributions (DiscordInteractionContext ctx) user.Id
|
||||||
|
|
||||||
[<SlashCommand("invited-people", "Get total invites from a specific user")>]
|
// [<SlashCommand("invites-clear", "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")>]
|
|
||||||
member this.ClearInvites (ctx : InteractionContext) =
|
member this.ClearInvites (ctx : InteractionContext) =
|
||||||
clearInvites (DiscordInteractionContext ctx)
|
clearInvites (DiscordInteractionContext ctx)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user