Skip to content

Commit 944b590

Browse files
committed
add repo language to message
1 parent 6443b91 commit 944b590

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

β€Ž.env.exampleβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
NOSTR_PRIVATE_KEY=your_nostr_private_key
22
BOT_TOKEN=your_telegram_bot_token
33
TELEGRAM_CHAT_ID=your_telegram_chat_id
4-
NOSTR_RELAYS=wss://jellyfish.land,wss://relay.nostr.band
4+
NOSTR_RELAYS=wss://jellyfish.land
55

66
APP_ID=000000
7-
WEBHOOK_PROXY_URL=""
87
WEBHOOK_SECRET=""
98
PRIVATE_KEY=""

β€Žcompose.ymlβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3.8"
2+
3+
services:
4+
zapounty:
5+
image: ghcr.io/zigbalthazar/zapounty:v0.0.4
6+
ports:
7+
- "6996:3000"
8+
environment:
9+
- NOSTR_PRIVATE_KEY=
10+
- BOT_TOKEN=
11+
- TELEGRAM_CHAT_ID=
12+
- NOSTR_RELAYS=wss://jellyfish.land
13+
- APP_ID=
14+
- WEBHOOK_SECRET=
15+
- PRIVATE_KEY=
16+
-----BEGIN RSA PRIVATE KEY-----
17+
18+
-----END RSA PRIVATE KEY-----

β€Žsrc/main.tsβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default (app: Probot) => {
99
try {
1010
const issue = context.payload.issue;
1111
const label = context.payload.label?.name;
12+
const lang = context.payload.repository.language ?? "Unknown"
1213

1314
if (label === "zap reward") {
1415
const comments = await context.octokit.issues.listComments({
@@ -22,7 +23,7 @@ export default (app: Probot) => {
2223
.find((request) => request !== null);
2324

2425
if (zapRequest) {
25-
const message = generateMessage(zapRequest.amount, issue.title, issue.html_url);
26+
const message = generateMessage(zapRequest.amount, issue.title, issue.html_url, lang);
2627
await sendToAll(message);
2728
}
2829
}
@@ -35,10 +36,11 @@ export default (app: Probot) => {
3536
try {
3637
const comment = context.payload.comment.body;
3738
const issue = context.payload.issue;
39+
const lang = context.payload.repository.language?? "Unknown"
3840
const zapRequest = parseZapReward(comment);
3941

4042
if (zapRequest) {
41-
const message = generateMessage(zapRequest.amount, issue.title, issue.html_url);
43+
const message = generateMessage(zapRequest.amount, issue.title, issue.html_url, lang);
4244
await sendToAll(message);
4345
}
4446
} catch (error) {
@@ -86,11 +88,12 @@ function parseZapReward(comment: string) {
8688
}
8789
}
8890

89-
function generateMessage(amount: number, title: string, link: string): string {
91+
function generateMessage(amount: number, title: string, link: string, language: string): string {
9092
return (
9193
`🌟 New Zap Reward Request 🌟\n\n` +
9294
`**Issue:** πŸ“Œ ${title}\n\n` +
93-
`**Amount:** ${amount} Sats ⚑ \n\n` +
95+
`**Amount:** ${amount} ⚑ Sats \n\n` +
96+
`**Language:** πŸ’» ${language}\n\n` +
9497
`This reward has been requested for the following issue:\n` +
9598
`πŸ”— View Issue Here:\n${link}\n\n` +
9699
`Thank you for your participation! πŸŽ‰\n\n` +

0 commit comments

Comments
Β (0)