Skip to content

Commit 18df9a1

Browse files
committed
add user
1 parent 3c8e8eb commit 18df9a1

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

.dev.vars.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
WEBHOOK=""
22
KOFISECRET=""
3+
PINGUSERID=""

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"KOFISECRET": {
2222
"type": "string",
2323
"description": "**REQUIRED** Kofi Verification Token. This is used to verify that the request is coming from Kofi. Get in the [Advanced Drop Down](https://ko-fi.com/manage/webhooks) of your Kofi page."
24+
},
25+
"PINGUSERID": {
26+
"type": "string",
27+
"description": "**REQUIRED** Discord User ID to ping on donations. This is used to notify a specific user in Discord when a donation is made. Use `&` in front to ping a role"
2428
}
2529
}
2630
}

src/worker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export default {
33

44
let WEBHOOK = env.WEBHOOK
55
let verification_token = env.KOFISECRET;
6+
let userping = env.PINGUSERID
67

78
if (!WEBHOOK || !verification_token) {
89
return new Response('Environment variables WEBHOOK and KOFISECRET must be set', { status: 500 });
@@ -35,7 +36,7 @@ export default {
3536
const message = payload.message || "";
3637
const url = payload.url || "https://ko-fi.com/";
3738

38-
const content = `+${amount} from **${name}**: ${message}\n-# <@569910296303632414>`;
39+
const content = `+${amount} from **${name}**: ${message}\n-# <@${userping}>`;
3940

4041

4142
const components = {

0 commit comments

Comments
 (0)