Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9e0122
feat: add release workflow and GoReleaser configuration
buddhiwann Nov 28, 2025
0469453
feat: implement memo caching in Send API and enhance Cache utility
buddhiwann Nov 28, 2025
b1503de
feat: add duplicate memo check in Send API to prevent reprocessing tr…
buddhiwann Dec 1, 2025
e0a75bd
feat: update Telegram notification logic in release workflow to suppo…
buddhiwann Dec 1, 2025
debec87
ci: use Actions variables for release chat IDs (RELEASE_CHAT_IDS, DEV…
buddhiwann Dec 1, 2025
7ba9fb4
feat: implement memo locking mechanism in Send API to prevent duplica…
buddhiwann Dec 1, 2025
37dcf97
feat: add step to create local tag in release workflow
buddhiwann Dec 1, 2025
7d5f488
feat: update custom tag format in release workflow to include version…
buddhiwann Dec 1, 2025
13897a5
feat: update version tagging logic in release workflows to use calcul…
buddhiwann Dec 1, 2025
d85c77a
feat: upgrade setup-go action to v6 and use PR title in Telegram noti…
buddhiwann Dec 2, 2025
33f57cf
feat: update custom tag format in release workflow to use short SHA
buddhiwann Dec 2, 2025
c24dca7
feat: update custom tag format in release workflow to include version…
buddhiwann Dec 2, 2025
8cd60eb
feat: enhance Telegram notification to include PR body description
buddhiwann Dec 2, 2025
8a6c642
feat: implement standing order feature with creation, listing, and de…
mrcentimetre Mar 25, 2026
a48e50e
feat: update standing order help text and add command descriptions in…
mrcentimetre Mar 25, 2026
3adb6b9
feat: improve error message for standing order creation failure
mrcentimetre Mar 25, 2026
0562b7f
feat: add analytics API endpoints and filter empty telebot errors (#58)
xbuddhi Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Dev Release

on:
push:
branches:
- dev

permissions:
contents: write

jobs:
release-dev:
runs-on: ubuntu-latest
env:
BOT_TOKEN: ${{ secrets.MAIN_BOT_TOKEN }}
CHAT_ID: ${{ vars.DEV_RELEASE_CHAT_IDS }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.21'

- name: Get short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Calculate next version
id: calc_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
tag_prefix: "v"

- name: Tag dev build
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: v${{ steps.calc_version.outputs.major }}.${{ steps.calc_version.outputs.minor }}.${{ steps.calc_version.outputs.patch }}-${{ steps.vars.outputs.sha_short }}
tag_prefix: ""

- name: Create local tag
run: git tag ${{ steps.tag_version.outputs.new_tag }}

- name: Run GoReleaser (dev)
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Mark as prerelease
run: gh release edit ${{ steps.tag_version.outputs.new_tag }} --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Telegram (Dev)
if: success()
run: |
IFS=',' read -ra TARGETS <<< "${{ env.CHAT_ID }}"
for target in "${TARGETS[@]}"; do
target=$(echo "$target" | xargs)
if [[ -z "$target" ]]; then
continue
fi
if [[ "$target" == *":"* ]]; then
chat_id=${target%%:*}
thread_id=${target#*:}
curl -s -X POST https://api.telegram.org/bot${{ env.BOT_TOKEN }}/sendMessage \
-d chat_id="$chat_id" \
-d message_thread_id="$thread_id" \
-d text="🧪 *New Dev Build Published!*%0A%0A*Tag:* ${{ steps.tag_version.outputs.new_tag }}%0A*Commit:* ${{ github.sha }}%0A*Author:* ${{ github.actor }}%0A%0A[View Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag_version.outputs.new_tag }})" \
-d parse_mode="Markdown"
else
curl -s -X POST https://api.telegram.org/bot${{ env.BOT_TOKEN }}/sendMessage \
-d chat_id="$target" \
-d text="🧪 *New Dev Build Published!*%0A%0A*Tag:* ${{ steps.tag_version.outputs.new_tag }}%0A*Commit:* ${{ github.sha }}%0A*Author:* ${{ github.actor }}%0A%0A[View Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag_version.outputs.new_tag }})" \
-d parse_mode="Markdown"
fi
done
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
pull_request:
types: [closed]
branches:
- main

permissions:
contents: write

jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
BOT_TOKEN: ${{ secrets.MAIN_BOT_TOKEN }}
CHAT_ID: ${{ vars.RELEASE_CHAT_IDS }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.21'

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch

- name: Create local tag
run: git tag ${{ steps.tag_version.outputs.new_tag }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Telegram Success
if: success()
run: |
# Escape PR body for JSON
ESCAPED_BODY=$(echo "$PR_BODY" | jq -R -s '.')
# Remove enclosing quotes from jq output
ESCAPED_BODY="${ESCAPED_BODY:1:-1}"
# Truncate if too long (Telegram limit is 4096 chars, so 3000 is safe)
if [ ${#ESCAPED_BODY} -gt 3000 ]; then
ESCAPED_BODY="${ESCAPED_BODY:0:3000}..."
fi

IFS=',' read -ra TARGETS <<< "${{ env.CHAT_ID }}"
for target in "${TARGETS[@]}"; do
target=$(echo "$target" | xargs)
if [[ "$target" == *":"* ]]; then
chat_id=${target%%:*}
thread_id=${target#*:}
curl -s -X POST https://api.telegram.org/bot${{ env.BOT_TOKEN }}/sendMessage \
-d chat_id="$chat_id" \
-d message_thread_id="$thread_id" \
-d text="🚀 *New Release Published!*%0A%0A*Version:* ${{ steps.tag_version.outputs.new_tag }}%0A*Title:* ${PR_TITLE}%0A*Author:* ${{ github.actor }}%0A%0A*Description:*%0A${ESCAPED_BODY}%0A%0A🔗 *Release Link:*%0Ahttps://github.com/${{ github.repository }}/releases/tag/${{ steps.tag_version.outputs.new_tag }}" \
-d parse_mode="Markdown"
else
curl -s -X POST https://api.telegram.org/bot${{ env.BOT_TOKEN }}/sendMessage \
-d chat_id="$target" \
-d text="🚀 *New Release Published!*%0A%0A*Version:* ${{ steps.tag_version.outputs.new_tag }}%0A*Title:* ${PR_TITLE}%0A*Author:* ${{ github.actor }}%0A%0A*Description:*%0A${ESCAPED_BODY}%0A%0A🔗 *Release Link:*%0Ahttps://github.com/${{ github.repository }}/releases/tag/${{ steps.tag_version.outputs.new_tag }}" \
-d parse_mode="Markdown"
fi
done

9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ data/*
LightningTipBot
LightningTipBot.exe
BitcoinDeepaBot
test_pay_api.sh
test_pay_api.sh

.DS_Store
.claude/settings.local.json
analytics_export.py
analytics_requirements.txt
ANALYTICS_API.md
ANALYTICS_QUICKSTART.md
Comment on lines +12 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for analytics documentation in the repository

# Search for analytics-related markdown files that are committed
fd -e md -t f . | rg -i 'analytics'

# Search for references to analytics in README or docs
rg -i 'analytics' README.md docs/ --type md 2>/dev/null || echo "No analytics references found in README or docs/"

Repository: CeyLabs/BitcoinDeepaBot

Length of output: 115


🏁 Script executed:

# Check if the analytics files exist in the working directory
ls -la | grep -i analytics

# Look at the git status to see what files are modified/added
git status

# Check the full .gitignore context
head -20 .gitignore

# Search for any analytics-related files in the entire repo
find . -type f -name "*analytics*" 2>/dev/null | head -20

Repository: CeyLabs/BitcoinDeepaBot

Length of output: 406


🏁 Script executed:

# Check recent commits
git log --oneline -20

# Check if there are other feature documentation patterns
find . -name "*.md" -type f | head -20

# Look at the structure of internal/api to understand the analytics implementation
ls -la internal/api/ | head -20

# Check git log for this specific .gitignore file
git log --oneline .gitignore | head -10

Repository: CeyLabs/BitcoinDeepaBot

Length of output: 1138


🏁 Script executed:

# Check the size and content summary of analytics.go
wc -l internal/api/analytics.go

# Look for documentation comments in analytics.go
head -100 internal/api/analytics.go

# Check if README mentions analytics API
grep -n -A 5 -B 5 -i "analytics" README.md

# Check the commit to see what changed in .gitignore
git show 0562b7f -- .gitignore | head -40

Repository: CeyLabs/BitcoinDeepaBot

Length of output: 4926


Remove .gitignore entries for non-existent files.

The analytics feature is being added via analytics.go (620 lines with inline documentation of the API), but the .md documentation files and Python scripts referenced in .gitignore (lines 12-15) are not part of this PR. Adding .gitignore entries for non-existent files is unnecessary and creates maintenance clutter. Remove these entries unless they represent auto-generated or build artifacts that are actually produced by the build process.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore around lines 12 - 15, The .gitignore currently lists files that
don't exist in this PR—remove the entries analytics_export.py,
analytics_requirements.txt, ANALYTICS_API.md, and ANALYTICS_QUICKSTART.md from
.gitignore so it only ignores real or generated artifacts; if any are actually
generated by the build, instead add a comment explaining their generation and
ensure the build produces them, otherwise delete those four lines referencing
those filenames.

24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
project_name: BitcoinDeepaBot
builds:
- env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
flags:
- -a
- -installsuffix
- cgo
ldflags:
- -s -w
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
17 changes: 16 additions & 1 deletion config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,23 @@ generate:
nostr:
private_key: "hex private key here"

# API Send Configuration
# API Configuration
api:
# Analytics API - HMAC authenticated endpoints for data export
# Generate secrets with: openssl rand -hex 32
analytics:
enabled: true
timestamp_tolerance: 300 # seconds (5 minutes)
api_keys:
data-team:
name: "Data Team"
hmac_secret: "your-analytics-hmac-secret-here"
# Add more keys for different consumers:
# dashboard:
# name: "Internal Dashboard"
# hmac_secret: "another-secure-secret-here"

# Send API - wallet-based HMAC authenticated endpoints
send:
enabled: true
internal_network: "10.0.0.0/24"
Expand Down
Loading
Loading