You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -5,7 +5,7 @@ description: Explains how to automate Right to Erasure requests with webhooks an
5
5
6
6
The **General Data Protection Regulation (GDPR)** is a European regulation on data protection and privacy. It grants individuals the right to request the deletion of their personal data, known as the [right to erasure](https://gdpr-info.eu/art-17-gdpr/). If you store any **Personally Identifiable Information (PII)** of your users, such as their User IDs, you must comply with GDPR requirements by deleting this information upon receiving a user's request.
7
7
8
-
Instead of handling requests manually, you can [set up a webhook](../../cloud/webhooks/webhook-notifications.md) and use a bot within a third-party messaging application to automate the process. As [data stores](../../cloud-services/data-stores/index.md) being the most common way for storing PII data, this tutorial provides an example on how to create a bot within Guilded or Discord that uses the [Open Cloud API for data stores](../../cloud/guides/data-stores/index.md) to delete PII data as an automation solution.
8
+
Instead of handling requests manually, you can [set up a webhook](../../cloud/webhooks/webhook-notifications.md) and use a bot within a third-party messaging application to automate the process. As [data stores](../../cloud-services/data-stores/index.md) being the most common way for storing PII data, this tutorial provides an example on how to create a bot within Discord that uses the [Open Cloud API for data stores](../../cloud/guides/data-stores/index.md) to delete PII data as an automation solution.
9
9
10
10
## Workflow
11
11
@@ -17,7 +17,7 @@ Upon completing this tutorial, you should be able to create a locally-running cu
17
17
<Alertseverity="warning">
18
18
To use this solution, make sure your data store keys are identifiable by User IDs, such as containing User IDs as substrings, or you need to modify the scripts to match your own data schema.
19
19
</Alert>
20
-
1. The bot responds to the webhook message in Discord or Guilded with the deletion status.
20
+
1. The bot responds to the webhook message in Discord with the deletion status.
@@ -27,29 +27,19 @@ Before creating a bot, set up a server with webhook integration on the third-par
27
27
28
28
### Set up a server
29
29
30
-
The following steps show how to set up the server using Guilded or Discord.
30
+
The following steps show how to set up the server using Discord.
31
31
32
-
<Tabs>
33
-
<TabItemlabel="Guilded">
34
-
1. Create a new Guilded server. If you are unfamiliar with the process, see [Guilded Support](https://support.guilded.gg/hc/en-us/articles/1500002751582-Create-a-Server).
35
-
1. Under the **Privacy** settings, set the server to private. The server automatically creates a private **#general** channel as your default channel.
36
-
1. Create a webhook integration with the new server and give it a name that you can easily understand, such as `GDPR Hook`. If you are unfamiliar with the process, see [Guilded Support](https://support.guilded.gg/hc/en-us/articles/360038927934-Incoming-Webhooks).
37
-
1. Copy the webhook URL and store it in a secure place. Only allow trusted team members to access it, as leaking the URL can enable bad actors to send fake messages and potentially delete your user data.
38
-
</TabItem>
39
-
<TabItemlabel="Discord">
40
32
1. Create a new Discord server. If you are unfamiliar with the process, see [Discord Support](https://support.discord.com/hc/en-us/articles/204849977-How-do-I-create-a-server-).
41
-
<Alertseverity="info">
42
-
It's recommended to set your server as a private server to protect user security. See [Discord Support](https://support.discord.com/hc/en-us/articles/206143407-How-do-I-set-up-a-private-server-) if you are unfamiliar with the process.
43
-
</Alert>
33
+
34
+
<Alertseverity="info">
35
+
It's recommended to set your server as a private server to protect user security. See [Discord Support](https://support.discord.com/hc/en-us/articles/206143407-How-do-I-set-up-a-private-server-) if you are unfamiliar with the process.
36
+
</Alert>
44
37
45
38
1. The server automatically creates a **#general** channel as your default channel. Click the **Edit Channel** icon of the **#general** channel.
46
39
1. Under **Permissions**, set the channel to private.
47
40
1. Create a webhook integration with the new server, name it to `GDPR Hook`. If you are unfamiliar with the process, see [Discord Support](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks).
48
41
1. Copy the webhook URL and store it in a secure place. Only allow trusted team members to access it, as leaking the URL can enable bad actors to send fake messages and potentially delete your user data.
49
42
50
-
</TabItem>
51
-
</Tabs>
52
-
53
43
### Configure a webhook on Roblox
54
44
55
45
After obtaining the third-party server URL, use it to [configure a webhook](../../cloud/webhooks/webhook-notifications.md#configure-webhooks-on-creator-dashboard) on Creator Dashboard. make sure you perform the following settings:
@@ -58,39 +48,15 @@ After obtaining the third-party server URL, use it to [configure a webhook](../.
58
48
Currently, only group owners can receive Right to Erasure requests for group-owned experiences. To implement the automation solution for a group-owned experience, make sure that the group owner configures the webhook.
59
49
</Alert>
60
50
61
-
- Add the Guilded or Discord server URL as the **Webhook URL**.
51
+
- Add the Discord server URL as the **Webhook URL**.
62
52
- Include a custom **Secret**. Though a secret is optional for completing the configuration, you should include one to prevent bad actors from impersonating Roblox and deleting your data. For more information on the usage of a secret, see [Verify webhook security](../../cloud/webhooks/webhook-notifications.md#verifying-webhook-security).
63
53
- Select **Right to Erasure Request** under **Triggers**.
64
54
65
55
You can test the webhook using the **Test Response** button to see if you receive a notification in your server's **#general** channel from Roblox. If you don't receive the notification, try again or check your server settings to troubleshoot the error.
66
56
67
-
<imgsrc="../../assets/misc/Webhooks-Sample-Notification.png"width="50%"alt="Example notification on Guilded"/>
68
-
69
57
## Configure a bot
70
58
71
-
After you add the webhook, use it to configure the bot with the following steps:
72
-
73
-
<Tabs>
74
-
<TabItemlabel="Guilded">
75
-
76
-
1. Open the **All servers** list by clicking its icon or use the shortcut:
77
-
78
-
- <kbd>Ctrl</kbd><kbd>S</kbd> on Windows.
79
-
- <kbd>⌘</kbd><kbd>S</kbd> on Mac.
80
-
81
-
1. Select your server for receiving right to erasure notifications.
82
-
1. Expand the list under **Server home** and select **Manage Bots**.
83
-
1. The server automatically creates a private **#general** channel as your default channel.
84
-
1. Click the **Create a bot** button and add a bot name. Guilded redirects you to the bot configuration page.
85
-
1. Select the **API** section on the bot configuration page.
86
-
1. Under the **Tokens** section, click the **Generate Token** button.
87
-
1. Save and store the generated token in a safe place.
88
-
89
-
</TabItem>
90
-
91
-
<TabItemlabel="Discord">
92
-
93
-
Check out Discord's [documentation](https://discord.com/developers/docs/topics/oauth2#bot-vs-user-accounts) for latest instructions.
59
+
After you add the webhook, use it to configure the bot with the following steps. For more information, see the [Discord documentation](https://discord.com/developers/docs/topics/oauth2#bot-vs-user-accounts).
94
60
95
61
1. Navigate to the [Applications page](https://discord.com/developers/applications).
96
62
1. Create a new application and name it to `GDPR Bot`.
@@ -106,9 +72,6 @@ Check out Discord's [documentation](https://discord.com/developers/docs/topics/o
106
72
1. Under the **Privileged Gateway Intents** section, enable **Message Content Intent**.
107
73
1. In the Bot settings > **Build-A-Bot** section, save the bot token in a secure place for later steps. If you don't see the token, click the **Reset Token** button to generate a new one.
108
74
109
-
</TabItem>
110
-
</Tabs>
111
-
112
75
## Create an Open Cloud API key
113
76
114
77
To allow your third-party bot to access your data stores for storing PII data of users, [create an Open Cloud API key](../auth/api-keys.md) that can access your experiences and add the **Delete Entry** permission of data stores for data deletion. If you use ordered data stores for storing PII, you also need to add the **Write** permission of ordered data stores. After completion, copy and save the API key in a secure location to use it in later steps.
@@ -129,31 +92,16 @@ To obtain these identifiers:
129
92
130
93
## Add scripts
131
94
132
-
After you finish setting up the webhook, bot, and API key for data stores, add them to the scripts that implement the bot's automation logic. The following example uses Python 3:
95
+
After you finish setting up the webhook, bot, and API key for data stores, add them to the scripts that implement the bot's automation logic. The following example uses Python 3.
133
96
134
97
1. Install Python libraries using the following commands:
135
98
136
-
<Tabs>
137
-
<TabItemlabel="Guilded">
138
-
139
-
```bash title="Install Libraries"
140
-
pip3 install guilded.py==1.8.0
141
-
pip3 install requests
142
-
pip3 install urllib3==1.26.6
143
-
```
144
-
145
-
</TabItem>
146
-
<TabItemlabel="Discord">
147
-
148
99
```bash title="Install Libraries"
149
100
pip3 install discord
150
101
pip3 install requests
151
102
pip3 install urllib3==1.26.6
152
103
```
153
104
154
-
</TabItem>
155
-
</Tabs>
156
-
157
105
1. Copy and save the following scripts corresponding to different parts of the bot logic in the same directory:
158
106
159
107
```python title="bot_config.py"
@@ -315,7 +263,7 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
315
263
returnTrue
316
264
317
265
"""
318
-
Parses a received webhook messaged on Discord or Guilded. Extracts user ID, prevents replay attack
266
+
Parses a received webhook messaged on Discord. Extracts user ID, prevents replay attack
319
267
based on timestamp received, and verifies Roblox signature with configured secret to check for
320
268
validity.
321
269
"""
@@ -341,61 +289,6 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
341
289
return"", []
342
290
```
343
291
344
-
<Tabs>
345
-
<TabItem label="Guilded">
346
-
347
-
```python title="guilded_bot.py"
348
-
import guilded
349
-
import json
350
-
351
-
import bot_config
352
-
import data_stores_api
353
-
import message_parser
354
-
355
-
defrun():
356
-
client = guilded.Client()
357
-
358
-
@client.event
359
-
asyncdefon_ready():
360
-
print(f"{client.user} is listening to Right to Erasure messages")
await message.reply(f"Deleted ordered data stores data for "+
385
-
f"user ID: {user_id}, data: {dict(successes)}")
386
-
if failures:
387
-
await message.reply(f"Failed to delete ordered data stores data for "+
388
-
f"user ID: {user_id}, data: {dict(failures)}")
389
-
390
-
client.run(bot_config.BOT_TOKEN)
391
-
392
-
if__name__=="__main__":
393
-
run()
394
-
```
395
-
396
-
</TabItem>
397
-
<TabItem label="Discord">
398
-
399
292
```python title="discord_bot.py"
400
293
import discord
401
294
@@ -446,9 +339,6 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
446
339
run()
447
340
```
448
341
449
-
</TabItem>
450
-
</Tabs>
451
-
452
342
1. On the `bot_config.py`filefor main configuration of the bot:
453
343
454
344
1. Set `BOT_TOKEN` to the token generated by your bot.
@@ -461,22 +351,9 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
461
351
462
352
1. Execute the following command to run the bot:
463
353
464
-
<Tabs>
465
-
<TabItem label="Guilded">
466
-
467
-
```bash title="Run Guilded Bot"
468
-
python3 guilded_bot.py
469
-
```
470
-
471
-
</TabItem>
472
-
<TabItem label="Discord">
473
-
474
-
```bash title="Run Discord Bot"
475
-
python3 discord_bot.py
476
-
```
477
-
478
-
</TabItem>
479
-
</Tabs>
354
+
```bash title="Run Discord Bot"
355
+
python3 discord_bot.py
356
+
```
480
357
481
358
1. The bot then starts to listen and verify Roblox webhooks for right to erasure Requests and calls the Open Cloud endpoint for deleting the corresponding data store.
482
359
@@ -488,7 +365,7 @@ To ensure constant and secure execution of the scripts, save and run them locall
488
365
489
366
You can create and run a test message to verify that your custom program can properly handle right to erasure requests and delete PII data:
490
367
491
-
1. Send an HTTP`POST` request to your Guilded orDiscord webhook server with the following request body:
368
+
1. Send an HTTP`POST` request to your Discord webhook server with the following request body:
0 commit comments