Formatting
This commit is contained in:
		
							parent
							
								
									25f3c0b89d
								
							
						
					
					
						commit
						24f56c046c
					
				@ -251,7 +251,8 @@ let createInvite (ctx : IDiscordContext) =
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let embed =
 | 
					        let embed =
 | 
				
			||||||
            DiscordEmbedBuilder()
 | 
					            DiscordEmbedBuilder()
 | 
				
			||||||
                .WithDescription($"Send this invite to your friend, when they join, they can type the `/enter-code` slash command")
 | 
					                .WithDescription($"Send this invite to your friend, when they join, they can type the `/enter-code` slash command\n\n
 | 
				
			||||||
 | 
					                                 ```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 Code")
 | 
					                .WithTitle("Invite Code")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -41,16 +41,19 @@ let createInvite inviter code =
 | 
				
			|||||||
    |> Async.AwaitTask
 | 
					    |> Async.AwaitTask
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let addInvitedUser did code =
 | 
					let addInvitedUser did code =
 | 
				
			||||||
    connStr
 | 
					    try
 | 
				
			||||||
    |> Sql.connect
 | 
					        connStr
 | 
				
			||||||
    |> Sql.executeTransactionAsync [
 | 
					        |> Sql.connect
 | 
				
			||||||
        """
 | 
					        |> Sql.executeTransactionAsync [
 | 
				
			||||||
            WITH invite AS (SELECT id FROM invite WHERE code = @code)
 | 
					            """
 | 
				
			||||||
            INSERT INTO invited_user (discord_id, invite_id) SELECT @discord_id, invite.id FROM invite;
 | 
					                WITH invite AS (SELECT id FROM invite WHERE code = @code)
 | 
				
			||||||
        """ , [ [ "@discord_id" , Sql.string (string did) ] ; [ "@code" , Sql.string code ] ]
 | 
					                INSERT INTO invited_user (discord_id, invite_id) SELECT @discord_id, invite.id FROM invite;
 | 
				
			||||||
        "UPDATE invite SET count = count + 1 WHERE code = @code" , [ [ "@code" , Sql.string code ] ]
 | 
					            """ , [ [ "@discord_id" , Sql.string (string did) ] ; [ "@code" , Sql.string code ] ]
 | 
				
			||||||
    ]
 | 
					            "UPDATE invite SET count = count + 1 WHERE code = @code" , [ [ "@code" , Sql.string code ] ]
 | 
				
			||||||
    |> Async.AwaitTask
 | 
					        ]
 | 
				
			||||||
 | 
					        |> Async.AwaitTask
 | 
				
			||||||
 | 
					        |> Async.Ignore
 | 
				
			||||||
 | 
					    with _ -> async.Zero ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let getInviteAttributions userId =
 | 
					let getInviteAttributions userId =
 | 
				
			||||||
    connStr
 | 
					    connStr
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user