Skip to content

This bot provides a simple integration with payhip webhooks. Possible more in the future????

License

Notifications You must be signed in to change notification settings

Redon-Tech/integrations-bot

Repository files navigation

Payhip Sales Integration Bot

A lightweight Discord bot that integrates Payhip with Discord to deliver real-time sales, refund, and subscription notifications. Receive beautifully formatted embeds with product details, coupon tracking, and multi-item purchase support directly in your Discord channels. Built with Node.js and discord.js, this bot makes tracking your Payhip sales effortless.


Quick Start

  1. Clone the repository:
git clone https://github.com/Redon-Tech/integrations-bot.git
cd integrations-bot
  1. Install dependencies:
npm install
  1. Copy and edit config files:
cp src/config/template.config.json src/config/config.json
cp src/config/.env.template src/config/.env
  • Edit src/config/config.json for channel IDs, webhook config, and other settings.
  • Edit src/config/.env for your Discord bot token and client ID.
  1. Run the bot:
node src/bot/Handler.js

Or use PM2 for production. 5. Invite the bot to your server:

  • Use the OAuth2 URL from the Discord Developer Portal with bot and applications.commands scopes.

For full details, see the Installation & First Run Guide.


Features

  • Real-time Notifications: Instant Discord notifications for Payhip sales, refunds, and subscriptions
  • Rich Embeds: Beautifully formatted sale information including:
    • Product names (with sale indicators)
    • Total price and currency
    • Payment method
    • Coupon usage and savings
    • Transaction IDs
    • VAT status
  • Multi-Product Support: Handles single and multi-item purchases
  • Configurable: JSON-based configuration for channels, hex colors, and webhook settings
  • Live Config Reload: Change config from Discord without restarting the bot
  • SQL Database: All sales, refunds, and subscriptions tracked in SQLite with external SQL files
  • Logging: Comprehensive logging with timestamps and error tracking
  • Admin Tools: Slash commands for config, stats, and options

Commands

  • /sales — View recent sales
  • /stats — View sales statistics
  • /config — Configure bot settings (admin only, live reload)
  • /configoptions — View available config keys for a section
  • /test — Send test webhook notification
  • /help — Display available commands
  • /botinfo — Displays information about the bot

Documentation


Planned Features

  • Multi-Tenant Support (future):
    • Multiple Payhip accounts per bot instance
    • Per-tenant webhook endpoints and Discord channel routing
    • Tenant-specific configuration management
  • Web Dashboard (future):
    • Real-time sales monitoring
    • Analytics and reporting
    • Configuration management UI
    • Webhook endpoint management
    • Bot status and health monitoring

Roadmap

  • Basic webhook receiver (Express server)
  • Discord bot foundation with event handling
  • Sales/refund/subscription notification embeds
  • Coupon/discount tracking
  • Logging system with daily log files
  • Environment-based configuration
  • SQL-based database with external schema and query files
  • Config command with live reload (no restart required)
  • Admin tools for config and stats
  • Multi-tenant support
  • Web dashboard

About

This bot provides a simple integration with payhip webhooks. Possible more in the future????

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •