In this article, we will create a KYC reward system for the user who shares his twitter profile for the first time. User will be awarded 10 kyc points if he/she updates the profile for the first time.
Note: The user can still use the command after first time to update their profile but they won't get kyc points as a reward.
Step 1: Set-up the Member Fields
Go to your BotDisco Dashboard
Click on the Member Fields tab on your left
Now create 3 Member Fields as follows:
Name | Type | Description |
kyc_score | Number | To store KYC score of the user |
Text | To save twitter profile link | |
twitter_update_count | Number | Number of times profile updated |
Step 2: Create Custom Slash commands to save twitter profile
Now we will create a custom slash command so the user can input his/her twitter profile link.
Open the BotDisco Dashboard.
Click on the "+ New Flow" button.
Select the trigger named "Custom Slash Command".
Name the command as "twitter". Enter the description of the command.
Click the dropdown menu of "Options" and Select "Add Options".
Select "Text" since the profile link would be a text. Check if the Required field is "On".
Finally name the input variable as "twitter_profile". Write a description of the variable (Here, "Add your twitter url").
Step 3: Check and save Twitter profile
Next, we want to check and update the twitter profile of the user in the member field called "Twitter".
Click "Add Action" and select "Filter".
Check if the user input "twitter_profile" contains twitter in its URL or not.
If that is true, Click 'Add Action" and select "Set Member Field".
Then select "Twitter" member field and update it with user input i.e. "twitter_profile" variable.
Also, select "Set Member Field" again to increase "twitter_update_count to "1".
Step 4: Award 10 kyc points to the user, if Twitter profile updated first time
Now, we'll check if the twitter is updated for the first time or not. If yes, then 10 kyc points would be awarded to the user.
Click "Add Action" and select "Filter".
Check if the user input "twitter_update_count" is equal to 1.
If that is true, Click 'Add Action" and select "Set Member Field".
Then select "kyc_score" member field and increase it by 10.
Finally, send a direct message to the user that he is awarded 10 kyc points for updating his twitter profile for the first time.
Step 5: Test the command on your Discord server